- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2020 03:58 AM
I have a catalog item where end user attach a txt file with some data on it.How can i get access of attachment data's in flow design?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2020 10:01 AM
Hi,
end user when attaches file to catalog during submission it gets attached to the RITM record.
From that you can use the Lookup attachment action and then the custom flow action
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2020 09:16 AM
Currently out of the box there is no direct action/step which would give you the Attachment content.
So you will have to create custom action for this and pass the attachment record sys_id to that action as input
The action would have script which would then query the sys_attachment and get the content and then set the output as this value
Refer sample script on how to get attachment content with attachment sys_id
(function execute(inputs, outputs) {
var sysId = inputs.sys_id;
var attGr = new GlideRecord('sys_attachment');
attGr.addQuery('sys_id', );
attGr.query();
if(attGr.next()){
var gsu = (typeof GlideStringUtil != 'undefined') ? (GlideStringUtil) : (Packages.com.glide.util.StringUtil); //few versions support the first one, other supports second
var gsa = (typeof GlideSysAttachment != 'undefined') ? (new GlideSysAttachment()) : (new Packages.com.glide.ui.SysAttachment());
var attachmentData = gsa.getBytes(attGr);
var attachment = String(Packages.java.lang.String(attachmentData));
outputs.duration = attachment;
})(inputs, outputs);
Refer below links for help on how to create custom flow action
Custom Action in ServiceNow Flow Designer
Creating a custom Event Action in Flow Designer
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2020 09:32 AM
I do not have file name as file is uploaded by end user.So, i dont think i can use look up attachment action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2020 10:01 AM
Hi,
end user when attaches file to catalog during submission it gets attached to the RITM record.
From that you can use the Lookup attachment action and then the custom flow action
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2020 10:17 AM
you are awesome.Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2023 02:14 AM - edited ‎07-06-2023 02:16 AM
Hi, Ankur when i create a catalog item with attachment variable, from the attachment to group table through servicenow using flow designer. If the excel attachment is attached with group member and group name then need to load the data into servicenow group member table using the flow designer. can you please help to achieve it