Add Hyperlink to alert

Rakshanda Kunte
Tera Contributor

Hi All,

 

I have created an action in flow designer which creates a change request from an alert.

I want to add a clickable link/anything around change 'Number' field. 

 

I tried to create a URL type field and given below line of code in this field. It gives the clickable URL but does not give the Alert which I given as an input in the action .

 

Can anyone please help?

RakshandaKunte_0-1684325666553.png

 

4 REPLIES 4

Community Alums
Not applicable

Hi @Rakshanda Kunte ,

gs.addInfoMessage() runs at server side and this server side script should trigger as per the actions performed by a certain user.

For example, we have a before Insert/Update Business Rule called "Caller Close" that generates the uses this API and generates the info message like the above screenshot whenever a Caller closes/resolves an incident.

So for example, a hyperlink that redirects you to incident list view can be defined in this business rule.

The following statements are self-explanatory regarding achieving this:

var link = '<a href="incident_list.do">List Link</a>';
var message = gs.getMessage('Incident Resolved') + ' ' + link + ' ';
gs.addInfoMessage(message);

OR, g_form.addInfoMessage("<a href='www.google.com' target='_blank'>Google</a>");

 

 

Hi Sandeep

 

instead of info messgae i want an alert button

 

JPSS_0-1720067077844.png

but its not showing. Can you please help

Rahul Kumar17
Tera Guru

Hi,

To create a clickable link around the change number field in your Flow Designer action output, you can use the HTML template option for the field. Here's an example of how you can achieve this:

  1. Create a new field of type "HTML" in your action output. Let's call it "Change Number Link."

  2. In the HTML template for the "Change Number Link" field, enter the following code:

<a href="CHANGE_URL">CHANGE_NUMBER</a>

Replace CHANGE_URL with the URL of your change record, and replace CHANGE_NUMBER with the dynamic field reference to the change number from the alert input.

For example, if the dynamic field reference for the change number from the alert input is {{data.alert.change_number}}, the code should look like this:

 

<a href="CHANGE_URL">{{data.alert.change_number}}</a>

 

  3. Save the action and test it. The change number field should now display as a clickable link in the action output, redirecting you to the specified change record URL when clicked.

Make sure to adjust the dynamic field reference and URL according to your specific setup.

 

Thanks,

Rahul Kumar

If my response helped please mark it correct and close the thread.

Thanks,
Rahul Kumar

instead of flow it should be a ui action