How can we call sys_ui_message in a flow

vijani
Tera Expert

I have some content that includes variables like subject person, 'opened for', and HR service. I want to create a system UI message (multiple languages) using this content. Then, I want to use this message in a flow to update the hr case comment field dynamically, based on the subject person and watch list users he profiles language. Could you help me to achieve this?

 

Ui message:
dear opened for first_name opened for last_name
your empoyee subject person first_name subject person last_name has passed the all the tests 
hence closing the case HRC000001
Thank You

HR Manager 
similarly, i have created sys ui message for other languages without variables

3 REPLIES 3

pavani_paluri
Giga Guru

Hi @vijani ,

 

Please a new message in System UI > Messages. with default language as English like below:

Dear ${opened_for.first_name} ${opened_for.last_name},
Your employee ${subject_person.first_name} ${subject_person.last_name} has passed all the tests.
Hence, closing the case ${case_number}.
Thank you,

HR Manager

 

  • Open the UI Message record. Under Translations, add language entries (e.g., French, German). Use the same key, but translate the message in that language.
  • You can create a script include to detect the logged in users language and replace the variables with actual values. I have attached sample script.
  • Add a script step in flow designer and call the script include. As an output you should send translated text with actual values.
  • Add the output of the step to case comments using Update Record action.

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P

GlideFather
Tera Patron

You can create a flow variable and call the message from there, then just use this variable within the flow

In the Flow designer navigate to the right upper corner - triple dots - Flow Variables:

KamilTEL_0-1751630927249.png

 

Create a variable by the (+) symbol in the right upper corner:

- name it and select its type > Save

KamilTEL_1-1751630935060.png


Then this variable can be used within that flow. Get to the step where you want to get the Message.

Add the Flow Logic > Set Flow Variable:

KamilTEL_0-1751631790093.png


NOTE: the variable is defined per flow, so if you would like to call the message in different flows, it might be annoying to go with this procedure...

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


https://www.servicenow.com/docs/bundle/washingtondc-build-workflows/page/administer/flow-designer/co...

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */