How to properly get value from variable used in a catalog item?

ericgilmore
Tera Guru

Created a service catalog item, with multiple variables.

Created a workflow with a notification activity that sends email upon form submission.

Used variables from the catalog item in the notification (advance, message) field via ${current.variables.var_name} which seems to do what I needed,

until, I realized that one variable, a Selectbox was sending the "text" attribute and not the actual "value" associated with the Selectbox item.

i.e. sending time{ 3:00 AM } text,   instead of time{ 03 } value

Is it a simple matter of adding a dot reference to traverse, i.e. ${current.variables.var_name.getValue()}

Or is that too simple.

--Thanks in advance

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

Try



${current.variables.var_name.getDisplayValue()}


View solution in original post

8 REPLIES 8

Without using getDisplayValue, I do not think the label of the choice is returned. Can you check your choice value definition and check if the text and the label is not the same.


Here's the setup;



selectBoxDefinition.jpg



And for the selectbox options:



selectBoxDefinition2.jpg



  - "3:00 AM" text returned with ${current.variables.class_begins_hour} in the notification activity message field


  - nothing returned with ${current.variables.class_begins_hour.getDisplayValue()}


Create a email notification script and use the following in the script


template.print(current.variables.sample_select_box);



Add the mail script call to the notification as


${mail_script:emai_notification_script_name}


While this would most likely be an easy thing for an admin, I am not. As such, I don't have access to [Helsinki > System Notification > Email > Notifications?]



Which means I'm limited to what I can do inside the [Helsinki > Workflow Editor] using the [Core Activity > Notifications > Create Event] activity at this point.