Need help with the UI builder iframe component. How can I make the URL dynamic based on a record fie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2023 09:45 AM
LOL Screen is a record page tab that contains an iframe component, and the URL is static, set to wikipedia.com.
How can I use a script to make the URL dynamic? For example, in the screenshot above, if the priority is 1, the URL should be set to wikipedia.com, and if the priority is 2, the URL should be set to google.com. How can I retrieve the field value in the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2023 02:46 AM
Depending on the page structure you have, you need to pass the priority field value to the iframe component. If iframe component is inside the child page, then from the parent page you can send the data to child page by creating a page property for eg. incidentPriority and later on in the script section inside iframe component, you can check that value by using the script,
if(api.context.props.incidentPriority==1){
return <URL1>;
}else return <URL2>;