For Each Data Pill is always undefined inside Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2025 02:37 AM
Hey,
I want to set a flow variable via script with the value from a "For Each"-Item. When I use the data pill I retrieve the correct value. When I want to use a script I always retrive "undefined".
The "Set Flow Variables"-Action is inside the "For Each"-Loop.
Where is my problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2025 02:43 AM
are you sure you are dot walking the correct level in the script?
can you try to type in and then use dot to see what suggestion it gives?
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2025 02:46 AM
Yeah, I am sure. It is build from the suggestions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2025 02:57 AM
can you give some other variable name instead of string
please print that in logs using gs.info() and check
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2025 03:04 AM - edited 05-30-2025 03:05 AM
Not possible