Script to get the reference data in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 04:30 PM
Hello,
I have a REST API returning a Array Object containing CI . I am looping thru the data and inserting into the respective CI table. How do I script to insert the Manufacturer or model ( which is a reference ).
Attached is the screenshot of what am doing and am struck with the script part
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 06:52 PM
Hi @maryc
You can use scripting in the field mapping by toggling the script section. Sample script in the below screenshot and update field, table and query according to your requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 07:11 PM
are you getting the manufacturer as well in API response?
if yes then you can map it directly
If not then use f(x) inline scripting and based on the CI record get the manufacturer
please share some more details
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader