Dynamic External Link on Caller Card In SOW

aditya2810
Tera Contributor

I need to create a hyperlink or link whatever it is in SOW in incident table on the caller card section , we have a record information section and there is the caller card which contains existing 2-3 hyperlinks emebeeded so I want to embed mine one also there and that if a person opens a incident record on sow then he should see a link there named "FA Details" and if he clicks there then it should redirect to that customised link for him which will open his FA details in a new tab .basically we have a field on user table "u_fa_number" so we need to fetch the fa number of caller on the incident record and then make the customised link .

This is example of link for one fa number : https://brd-falcm-sec.apps2.examplecompany.com/pmd/fa/{FA Number -437164}/practiceDetails .

This is the image which I am attaching that where I want to place that hyperlink.

I got the place where the other 3 are configured and duplicated the text link component as well but I am able to place a static link but not the dynamic link embedding current caller FA Number.

1 REPLY 1

Naveen20
ServiceNow Employee

 
Try this approach:

Step 1 — Ensure the caller's FA number is available via a Data Resource

Check if the existing Caller Card data resource already fetches dot-walked fields from the user table. If u_fa_number isn't included, either add it to the existing data resource or create a new Look up single record data resource on sys_user filtered by the caller's sys_id, and include u_fa_number in the return fields.

Step 2 — Bind the URL property using a Script binding

On your duplicated text link component, instead of setting a static URL, click the data binding icon next to the href / url property and switch to Script (or Formula) mode. Then use something like:

// Adjust the data resource path to match your actual binding
const faNumber = @state.callerDataResource.u_fa_number;
return faNumber 
  ? 'https://brd-falcm-sec.apps2.examplecompany.com/pmd/fa/' + faNumber + '/practiceDetails'
  : '';

The exact path depends on your data resource name — use the Data panel in UI Builder to browse and pick the correct binding path (it'll look something like @STate.<your_data_resource>.field_name).

Step 3 — Set "Open in new tab"

On the same text link component, set the target property to _blank so it opens in a new tab.

Step 4 — Conditionally show/hide

Optionally, set the component's visibility condition to hide the link when u_fa_number is empty, so users without an FA number don't see a broken link.