cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to insert API call data in CDS Entities using custom code in Power App Portal

Hi Experts,

 

I am trying to embed one open-source interface in my portal, which uses the Iframe to embed it in the portal and the logged-in user will interact with that embedded page and post-interaction it is going to give result in JSON format. We are trying to get the result data and store it in CDS entities. Below is the interface which we are embedding to the portal:

https://infermedica.com/

 

Could you please help me to direct in the right direction to use it in the portal? 

Few Queries:

1. How to store the output data in CDS Entities ( i.e Assesment_Data)?

2. How to relate it with contact entities or any other entities which is a parent of "Assesment_Data" entity.

3. Is there a way to get the result data using javascript/jquery/ajax/Web API etc.

 

Please help me with this requirement.

 

Thanks,

Amit

1 ACCEPTED SOLUTION

Accepted Solutions

thanks, it is clear what you need, but not clear how you will get the data back from the iFrame, I am assuming you got that part covered, am I right?

 

once you have the data back I think you can try the following different approaches:

 

1 - call a flow passing the data returned + the logged in user, you can get that via Liquid using {{ user.id }}

 

2 - having an entity form with everything hidden, including the submit button, via JS you can set the data into a field and force the button click

 

3 - going more custom using a companion app or portal actions approach: 

https://community.dynamics.com/365/b/udssystems/posts/https-uds-systems-blog

https://colinvermander.com/portal-companion-app/

 

4 - Microsoft will be releasing a CRUD API somewhere in June (in preview mode), so you can always wait until we have that so you will be able to perform the operations against your CDS data

 

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

View solution in original post

5 REPLIES 5
OliverRodrigues
Super User
Super User

I am bit confused with the mix of embedding an iframe and using API, I think you should either go for one or the other

 

if you want the data in your CDS you need to integrate with that system, have you checked if there is a connector in Flow/Power Automate to help you on that?

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Anonymous
Not applicable

Hi @OliverRodrigues 

 

Sry for not being clear, but basically what I want is when I embed the

<iframe id="hf-iframe" src=" https://covid19.infermedica.com/en/?header=false&language_selector=false"></iframe>

interface in my portal, then at the end of the user assessment, it returns JSON data. which I want to get and insert it in my CDS entities.

And Also while inserting the data to an entity, how can I link that record to logged-in user?

 

Please let me know if that clears your doubt.

 

Thanks,

Amit

thanks, it is clear what you need, but not clear how you will get the data back from the iFrame, I am assuming you got that part covered, am I right?

 

once you have the data back I think you can try the following different approaches:

 

1 - call a flow passing the data returned + the logged in user, you can get that via Liquid using {{ user.id }}

 

2 - having an entity form with everything hidden, including the submit button, via JS you can set the data into a field and force the button click

 

3 - going more custom using a companion app or portal actions approach: 

https://community.dynamics.com/365/b/udssystems/posts/https-uds-systems-blog

https://colinvermander.com/portal-companion-app/

 

4 - Microsoft will be releasing a CRUD API somewhere in June (in preview mode), so you can always wait until we have that so you will be able to perform the operations against your CDS data

 

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Anonymous
Not applicable

Hi @OliverRodrigues 

 

It helps in understanding that currently there is no CURD API available, but the options which you mentioned will help me to decide the approach. And yes, I am able to get the data from Iframe.

 

1st Option: This is the approach that you are referring to? (https://rajeevpentyala.com/2020/02/09/power-platform-pass-json-collection-from-canvas-app-to-power-a...)

2nd Option: I was thinking of this option but was looking for a better option (like CURD API).

3rd Option: I will go through this.

 

Thanks,

Amit

1st option would be more like this one: https://readyxrm.blog/2019/12/28/trigger-power-automate-flows-from-power-apps-portals/

 

remember that Portals is not a canvas app, so you can't use the one you mentioned




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel News & Announcements 768460.png

What's New in the Community?

Check out the latest News & Events in the community!

MPP IDEAS updated 768x460.png

Ideas

Discover ideas and concepts from users like you for how to use Power Pages and take your work to the next level.

Users online (1,717)