For Each Data Pill is always undefined inside Script

PaKe
Kilo Sage

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?

 

PaKe_0-1748597825828.pngPaKe_1-1748597858774.png

 

19 REPLIES 19

Ankur Bawiskar
Tera Patron
Tera Patron

@PaKe 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yeah, I am sure. It is build from the suggestions

PaKe_0-1748598386310.png

 

@PaKe 

can you give some other variable name instead of string

please print that in logs using gs.info() and check

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Not possible

 

PaKe_0-1748599472662.png