String to List Collector in Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2023 04:17 PM
Hi All,
I am attempting to create a flow that will take a comma separated list of sys_ids and call a catalog item with that information. The list would be populated into a List Collector in the catalog item. I can't seem to figure out how to convert the comma separated list to a List Collector. When I drag the comma separated list data pill to the Submit Catalog Item Request it says "String" is now allowed.
My use case is I have a catalog item that takes a list of users and creates a record of an activity. If the form is filled out via the Service Center, the user can select multiple users. I want to add a "REST API - Async" trigger that can be called from an automated process.
Any suggestions?
Thanks,
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2023 04:32 PM
Hi @benjaminmetzler ,
You need to create a custom flow action which would take the input as list collector (string) and then convert it into array and return back this array and leverage it with the for each loop.
Please refer to this article by: https://www.servicenow.com/community/developer-blog/using-list-collector-in-flow-designer-for-each-l...
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2023 04:52 PM
I tried a similar approach to the link, but when I try to use the data picker from the custom action, I get a not allowed to drop the data pill into the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2023 05:14 PM
@benjaminmetzler - please update the output type as 'Array.object' and check again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2023 03:13 PM
It also says the object os not allowed: