Output variable showing as {"variable":["[object ScopedGlideRecord]"]} instead of the choice value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2024 02:49 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2024 04:07 AM
Hi @janindiadoc_1 ,
Please check the below:
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2024 04:10 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2024 05:19 PM
Hi, are you able to clarify/share these two things?
- What does the info log show that you're running in your script?
- 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)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2024 06:31 PM
- What does the info log show that you're running in your script? - Please see the image attached SN_1.GIF
- 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.