Want a variable on the record producer to show Label instead of Value

Rylie Markle
Tera Contributor

I have a variable on a record producer mapped to pull over a field from the HR Profile. However, it is pulling the Value of the field instead of the Label. How can I change which one the variable displays. 

Can I edit this on the variable itself, or do I need to add a Client Script on the record producer?

find_real_file.png

 

find_real_file.png

1 ACCEPTED SOLUTION

Got it - so is your Process Level variable a string variable? If that is the case, you could modify the processLevel line from your script include as below and it should work:

homePhone : profileGR.getValue('u_ph_home_ph'), //GlideRecord.getValue() method returns string so you don't have to call toString()
processLevel : profileGR.getDisplayValue('u_process_level'), //GlideRecord.getDisplayValue() method returns string so you don't have to call toString()

If this answer is helpful please mark correct and helpful!

Regards,

Christopher Perry

If this answer is helpful please mark correct and helpful!

Regards,
Chris Perry

View solution in original post

6 REPLIES 6

chrisperry
Giga Sage

Hi there,

Could you please share the code for how you are populating the record producer variable right now?

Regards,

Christopher Perry

 

If this answer is helpful please mark correct and helpful!

Regards,
Chris Perry

Sure! The first picture below is from the script include and the second is from the Client Catalog Script on my record producer. 

find_real_file.png

 

 

find_real_file.png

find_real_file.png

Got it - so is your Process Level variable a string variable? If that is the case, you could modify the processLevel line from your script include as below and it should work:

homePhone : profileGR.getValue('u_ph_home_ph'), //GlideRecord.getValue() method returns string so you don't have to call toString()
processLevel : profileGR.getDisplayValue('u_process_level'), //GlideRecord.getDisplayValue() method returns string so you don't have to call toString()

If this answer is helpful please mark correct and helpful!

Regards,

Christopher Perry

If this answer is helpful please mark correct and helpful!

Regards,
Chris Perry