Flow Designer- Set a String Value to the Display Value of a Reference Field

jlaps
Kilo Sage

I am creating an asset history table to capture asset state/date/values at the time of the asset returning to stock so they do not change later when the asset gets reassigned. I created a new table, and am setting STRING fields on this new table to values on the alm_hardware table when the status changes for example.

 

If I want to set a CONFIGURATION ITEM field that is a string, from a CONFIGURATION ITEM field that is a reference, how do I get flow designer to do it using the display value instead of the sys_id I am getting now? I have it working where it sets the sys_id, so its grabbing the correct value, I just want the display value instead. I am assuming I need to edit the script piece?

 

jlaps_0-1724953298606.png

 

1 ACCEPTED SOLUTION

Hajar BENJAHHAR
Mega Sage

Hello @jlaps 

 

You can retrieve the name of the configuration item by using dot-walking. Please follow the steps highlighted in orange.I recommend avoiding the use of scripts, as the name can be obtained without any scripting.

Capture d'écran 2024-08-29 202246.png

 I hope you find this helpful!

 

Best regards, 

Hajar

 

 

View solution in original post

5 REPLIES 5

Piyus Padhy2000
Tera Contributor

 

Hi @jlaps 

I think I have the solution for your query.

In the flow, create a flow variable with the data type set to "String." Before setting the field values, use the "Set Flow Variables" logic and assign it to the flow variable you just created.

Next, write a script to set the value of the Configuration Item as a string:

 

var ci = fd_data.trigger.current.cmdb_ci.getDisplayValue();
return ci;

 

When setting the field value in the data picker, call the flow variable.

If you found this helpful, please mark it as helpful.

 
 

Hajar BENJAHHAR
Mega Sage

Hello @jlaps 

 

You can retrieve the name of the configuration item by using dot-walking. Please follow the steps highlighted in orange.I recommend avoiding the use of scripts, as the name can be obtained without any scripting.

Capture d'écran 2024-08-29 202246.png

 I hope you find this helpful!

 

Best regards, 

Hajar

 

 

Thank you. Expanding the  updated record and drilling down to the NAME field was exactly what I needed.

@jlaps That's what I also mentioned.