Output variable showing as {"variable":["[object ScopedGlideRecord]"]} instead of the choice value

janindiadoc_1
Tera Expert

I have a requirement to create tasks based on the list of values in the List datatype field. This field has got static values added as choices. I have created an action to convert the choice list values in to a string array as per Ankur's post https://community.servicenow.com/community?id=community_blog&sys_id=e244e902dbcc2010fb4ae15b8a9619c3

 

I'm getting this output in the variable while looping through the string variables as "{"variable":["[object ScopedGlideRecord]"]}". Not sure what's wrong here, but if i execute the action separately I could see the comma separated values has been put in to an array correctly. There are currently two values in my choice list and I'm trying to add those values as the subject of my task. Only one task is created instead of two and ""{"variable":["[object ScopedGlideRecord]"]}" is being set in my task subject.

 

Screenshot attached.

 

Appreciate any help

6 REPLIES 6

SN_Learn
Kilo Patron
Kilo Patron

Hi @janindiadoc_1 ,

 

Please check the below:

https://www.servicenow.com/community/developer-forum/issue-get-list-collector-value-in-flow-and-use-... 

 

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

I reviewed the solution, and it suggests looking up records from the table and checking the sys_ids. However, in my case, all the values are from choice lists, and since this is a scoped app, I don't have access to the sys_choice table. Is there an alternative approach to achieve this?

Nick Parsons
Mega Sage

Hi, are you able to clarify/share these two things?

  1. What does the info log show that you're running in your script?
  2. Can you share how you're triggering the action (ie: the step to get the catalog variable, and how you're passing it to your action in the parent flow)?

  1. What does the info log show that you're running in your script? - Please see the image attached SN_1.GIF
  2. Can you share how you're triggering the action (ie: the step to get the catalog variable, and how you're passing it to your action in the parent flow)? - I don't have a catalog item or RP. Its a backend list type field in the table with static choice values. For eg: A, B, C. When the backend record state changes the status to "Published", flow will be triggered and I need to create the tasks based on the number of choices selected in the list field from the form. For eg: If the list field has got 3 values selected, the loop through these 3 and create tasks accordingly.