Dynamic link on URL type field

shilpakamat
Tera Contributor

Hi,

 

I have created a URL type field called caseID. Requirement is if i click on the value it should redirect to an external link (caseID number should be added to the end of the link). Is it possible to achieve this? I have tried default value and calculated value it doesnt seem to work. 

 

Thanks in Advance,

Shilpa

5 REPLIES 5

Ankur Bawiskar
Tera Patron

@shilpakamat 

share the script you are using.

share screenshots

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

I tried adding below line in calculated value 

return "my URL"+current.getValue(case_id); but this cleared out the field value for all records.

I also tried adding the same line in default Value

"my URL"+current.case_id 

But when i click on the value its opening my instance URL+current.case_id

@shilpakamat 

that URL is for some other servicenow instance?

share complete details and screenshots

when should the URL be set? during record creation? etc?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

SourabhAkiwate
Tera Expert

Hello @shilpakamat , Good Day !!!

I assume, you created a field on "sn_customerservice_case" table.

Please use the below onLoad Client Script. (You can write onSubmit as well)

 

SourabhAkiwate_0-1771318637455.png

If you want to open the record in List view then, use the below format :

https://<instance>.service-now.com/<table_name>_list.do?sysparm_query=number=<case_number>

 

If my response becomes solve your problem then please mark this as "Helpful".

Thank you,

Sourabh A.