- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2018 09:36 AM
We have a requirement to create a record in our scoped app when a record with specific values is created in the Incident (incident) table. We'll be upgrading to Kingston soon, and would like to take advantage of its Flow Designer.
We've recently spun up a separate Kingston instance where we can experiment, and I'm able to set up the flow and create that record. But one of the requirements is to also copy any attachments that might also be placed on the Incident to our scoped app's record. I can't see how that is done using Flow Designer. Does anyone have any ideas? I looked in docs and Kingston release notes and nothing was obvious, but I may have missed it. Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2018 09:44 PM
Hello,
You need to create a custom action to copy attachments. We have covered it during the TechNow Episode 44(starts at 51:20) and the script is referenced below. You can adjust it as per your req.
https://www.youtube.com/watch?v=GtAFuOgnfU8&t=3071s
(function execute(inputs, outputs) {
// ... code ...
var x = GlideSysAttachment.copy('incident', inputs.incident_sysid, 'problem', inputs.problem_sysid);
var list = global.j2js(x); outputs.attachmentSysId = list.join(','); })(inputs, outputs);
Please let me know if you are blocked.
Thanks,
Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2018 09:44 PM
Hello,
You need to create a custom action to copy attachments. We have covered it during the TechNow Episode 44(starts at 51:20) and the script is referenced below. You can adjust it as per your req.
https://www.youtube.com/watch?v=GtAFuOgnfU8&t=3071s
(function execute(inputs, outputs) {
// ... code ...
var x = GlideSysAttachment.copy('incident', inputs.incident_sysid, 'problem', inputs.problem_sysid);
var list = global.j2js(x); outputs.attachmentSysId = list.join(','); })(inputs, outputs);
Please let me know if you are blocked.
Thanks,
Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2018 01:07 PM
Works great. Thanks very much for your help. I didn't need the resulting list of sys_ids of the attachments created, therefore didn't have to worry about creating a duplicate of j2js in our scoped app - just commented that part out.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2018 09:01 PM
You are very welcome. Let me know if that answered your question. If so, please mark the response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list. Thank you
Thanks,
Pradeep Sharma
@sharma_pradeep