Need to enable hyperlink in Variable Under Catalog item

vidyajadhav
Tera Contributor

vidyajadhav_0-1782299404730.png

Hi Team,

 

I have enabled this msg by writing below script in Catalog UI policy. But I want to add hyperlink so that user can click that link and can be routed to the Onboarding form. Which module i can use to enable this

 

var msg = "Choose the appropriate Project Business Role. " +
          "If you are not sure, please check with the Project Lead.<br><br>" +
          "Raise a separate request to complete the Business role onboarding " +
          "/sp?id=onboarding_formhere</a>, " +
          "if you cannot find your team's business role on the list.";

 

g_form.showFieldMsg('role_option', msg, 'info', false);
8 REPLIES 8

Rishabh_Garg
Mega Contributor

Hi Vidya,

  • You cannot populate link using g_form.showfieldmsg().
  • The g_form.showFieldMsg() method is primarily used to display messages (such as error, warning, or informational messages) below a field.

Hope this helps!

Thank you
Rishabh Garg

 

Aditya_hublikar
Mega Sage

Hello @vidyajadhav ,

 

To achieve the result shown in the screenshots, create a Rich Text Label variable in your Catalog Item and place it between the desired variables by setting the appropriate Order value. Open the Rich Text Label's Source Code editor and add HTML containing the message and hyperlink, along with inline CSS for the blue background and styling. Save the variable and test the Catalog Item in Service Portal. The label will appear as a highlighted information section with a clickable link that opens in a new tab. Adjust the Order field if you want to change its position on the form and here i applied ui policy to show and hide that rich text label .

 

Screenshot (1246) (1).pngScreenshot (1247) (1).pngScreenshot (1248) (1).pngScreenshot (1249) (1).png

 

 

If this helps you then mark it as helpful and accept as solution.

Regards,

Aditya

 

Aditya_hublikar
Mega Sage

Hello @vidyajadhav ,

 

show field msg by default work as string field so html content we cant add there . So we need to create that rich text label variable .

 

 

Mark Manders
Giga Patron

The message field is plain text. That's why your HTML isn't working. 
You could put a URL field under it, containing the URL.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark