passing flow variable value not working

ARAVINDA11
Tera Contributor

var trimmedValue = (inputs.u_flow_variable || '').trim();

 

Guys please help I have list collector in my catalog I used the value to pass into custom variable in flow and if i directly pass the value outside the loop without scipt it is working 

 

I tried to apply above script because i wanted to print in SC_task description in a sequence wise so i used trim function it is sending blank text please help me what i can do 

4 REPLIES 4

Shivalika
Mega Sage

Hello @ARAVINDA11 

 

Share full screenshots please 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY QQ

@Shivalika  @Ankur Bawiskar  see the screenshot or file attached i just need to pass flow variable value to entitlement field currently it i s ending blank vale even the values are present

ARAVINDA11_0-1743749534959.png

 

Hello @ARAVINDA11 

 

You have shown practically nothing in this screenshot, how are you assigning values to flow variables ? Where is this input coming from ? 

 

What can seeing logs help -  mean we already know flow variable is not printing - that's the issue. So need to know the background here. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

@ARAVINDA11 

so basically you are iterating list collector using For Each and are you appending the value in flow variable?

share how did you do that?

Then in the Entitlement inline script you should be able to access the flow variable like this

you were using wrong syntax and you need to return the value as well

// listcollectordisplayvalue is the name of flow variable

var flowVariableValue = fd_data.flow_var.listcollectordisplayvalue.toString().trim();
return flowVariableValue;

AnkurBawiskar_0-1743751342417.png

 

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