Embedding an IFRAME in a Creatio Freedom UI Page to Display API Data
Hi Creatio Community,
I am looking to consume my own or an external API that returns a JSON response and embed an IFRAME inside a Creatio Freedom UI page to display the relevant data.
My Goal:
Call an API that responds with JSON data.
Display the API response inside an IFRAME in Freedom UI.
Ensure the IFRAME updates dynamically based on API data.
My Questions:
- What is the best way to embed an IFRAME inside a Freedom UI page?
- How can I dynamically set the IFRAME's src based on API response data?
-
Are there any security or CORS restrictions I should be aware of when using an external API?
If anyone has experience implementing this in Freedom UI or has sample configurations, I'd love to hear your insights!
Thanks in advance!
Like
You ca see an example of embedding an IFRAME and setting the src of the IFRAME dynamically here: https://customerfx.com/article/embedding-an-iframe-on-a-creatio-freedom-ui-page/
However, an IFRAME cant just display data from an API. An IFRAME simply embeds another page, it would be the responsibility of the page you're embedding to retrieve and display the API data.
You could however, use a similar approach to the article for creating an IFRAME and just have that component retrieve the API data and render out HTML as needed. Alternatively, you could create a full Angular component that retrieves and displays the API data, which is likely a better route anyway. See https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/front-end-development/freedom-ui/remote-module/implement-a-remote-module/overview
As for CORS restrictions, that would be something imposed (or not) by the API, not Creatio.
Ryan