Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get label of choice variable in Flow Designer

AM24
Giga Guru

For a certain flow, I get catalog variables. One of them is a lookup select box. It looks at a certain value field from a table, which is a choice field, so there are labels and a value. I want to be able to access the labels in a flow designer script. So far, I am only able to get the values. getDisplayValue() is not working for this. I was wondering how I would be able to access the label.

1 ACCEPTED SOLUTION

Allen Andreas
Tera Patron

Hi,

Can you share what you've tried thus far?

.getDisplayValue() should work if used sort of like this (example😞

var lab = fd_data.trigger.request_item.variables.variable_name.getDisplayValue();

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

1 REPLY 1

Allen Andreas
Tera Patron

Hi,

Can you share what you've tried thus far?

.getDisplayValue() should work if used sort of like this (example😞

var lab = fd_data.trigger.request_item.variables.variable_name.getDisplayValue();

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!