Add reference field value from variable to short description on RITM

riskay123
Mega Guru

I have a catalogue item that has a reference variable on the form that references the sys_user table. This cat item uses a flow.

 

In the flow I have an Update Record action where I would like to update the Short description with some default text then the value of this variable. I have used the variable data selector and can select the variable but on the submitted RITM the Short description displays the default test and the sys id of the selected user rather than the variables value. 

 

How can I make it display the value if this variable on the Short description rather than the sys id please?

 

Thanks

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@riskay123 

you need to dot walk to name field from that data pill for that reference variable

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

riskay123
Mega Guru

I tried to do that, but I can't find the right path for the dot walking. I clicked on Trigger > Request Item Record > but from there I am unsure how to get to the variable option to select it. The crazy thing is I am sure I found it a few days ago but now I can't seem to find it.  Are you able to advise the correct dot walking path using the data picker.

brahmandlapally
Mega Guru

Hi @riskay123 

 

if You have an option to script you can use this method variablename.getDisplayValue(); this will return value instead of Sys id

thank you,

If my response helped please mark it correct.

Thanks for your reply. I am still not having any luck when I try to use a script either. I do not know java script so please bear with me.

 

If I use the data picker the task does trigger but with the sys id rather than the value. If I add a script, then the task doesn't at all. I have never added a script in Flow Designer before, so I am thinking I am doing something wrong here. I have used them in them old Workflow canvas though. I am adding it in here. Is this the right spot?

 

Cat Task Screenshot.png

 

I am aware that this script is not referencing the reference variable in this example. It is just a string, so it does not contain the getDisplayValue(); bit. I am just trying to work out why the task does not trigger when I add a script first then I will try your suggestion from above.

 

When I run a test on the flow I get Error: "task" is not defined.,Detail: "task" is not defined.

Do you know what that means and how I can fix it?

Thanks in advance.