Dynamic content URL (instance based)

tkrishna29
Giga Guru

Hi,

I'm using content URl to display on one of my catalog items.

find_real_file.png

How can I make my source URL dynamic according to the instance I'm in. Right now, I'm hard coding it on each and every instance. I'm trying to see if   the URL field can capture the base url.

Thanks,

Krishna

1 ACCEPTED SOLUTION

Hi Krishna,



Any update on this?


Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.



Regards


Ankur


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

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Krishna,



There is out of box system property which stores the instance name you can use that.



gs.getProperty('instance_name');



This will work in server side only.



If you want that in client side query sys_properties table and get that value



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


instance_name


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

Hi Ankur,


Thanks for the quick response. How can I add this to content URL field?



Regards,


Krishna


Hi Krishna,



Is that a catalog variable?


What exactly it is?



Regards


Ankur


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

Hi Krishna,



I think you are referring to content link under content management.


I consider that no need to give instance name there directly you can give relative URL i.e.



Try giving URL only after / i.e.



/nav_to.do ..................



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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