iFrame Can we use Dynamically created URL to UI Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 07:34 AM
I have created the iFrame with the following UI Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 12:03 PM
Hi @KKS515
This code should dynamically sets the location query parameter based on the location field of the incident record.
Make sure to include this code in your UI Macro to achieve your desired outcome.
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> <iframe src="https://abc.xyz?location={{incident.location}}" height="900px" width="1800px"></iframe> </j:jelly>
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Regards,
Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2023 09:26 AM
Thanks Tushar. We were able to create those jelly on UI macro. The issue is on the Macro is it won't get refreshed automatically during record change.
We are exploring alternatives on the macro.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2023 11:43 AM
Hi @KKS515
can you try this
<?xml version="1.0" encoding="utf-8"?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="incidentSysId" expression="${request.getParameter('sysparm_sys_id')}"/>
<g:if test="${incidentSysId}">
<g:evaluate var="incidentGR" expression="new GlideRecord('incident'); incidentGR.get(incidentSysId);"/>
<g:if test="${incidentGR.isValid()}">
<g:evaluate var="location" expression="incidentGR.getValue('location')"/>
<iframe src="https://abc.xyz?location=${location}" height="900px" width="1800px"></iframe>
</g:if>
</g:if>
</j:jelly>
please mark as Accepted Solution / Helpful if you get it 🙂