The CreatorCon Call for Content is officially open! Get started here.

Unable to pass Variable into HTML Template (specially into SRC URLs)

Nikhil Sharma
Tera Contributor

Hi Team,

 

I am trying to build a service portal where we need to show dynamic URLs on the screen. For this we are using iframe and from server and client script we are calling the URL in variables. However when we put variable in HTML Template in iframe or script i.e. src="URL" then it does not work. See below snapshot with three use cases - 

 

1. DIV - In this variable is working fine.

2. iframe with URL variable in SRC - This is not working

3. iframe with URL hardcoded in SRC - This is working fine.

 

My question is on 2nd point i.e. how to pass URLs as variable or part of URL as variables.

Attaching snapshot of results for better understanding.

 

1 ACCEPTED SOLUTION

Claude DAmico
Kilo Sage
3 REPLIES 3

Claude DAmico
Kilo Sage

I was able to get this working using information from https://community.servicenow.com/community?id=community_question&sys_id=fe0c4b25db9cdbc01dcaf3231f96....

find_real_file.png

Claude E. D'Amico, III - CSA

Nikhil Sharma
Tera Contributor

Thanks, I see you are using trust URL in the client controller. I guess this will solve my issue.

 

I will try and update here.

Nikhil Sharma
Tera Contributor

Its working after adding your method.