cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jamesmatson
Helper II
Helper II

Flow to get data from web API (JSON) into PowerApps is returning a false/true value instead of data?

I have a web API that produces JSON. I have written a flow to get that data via the HTTP action and return it to Power Apps via the Request / Response object. This is tied to the press of a PowerApps button, however the table where I expect these results to appear just has 'false' in it, and when I press the button, the app 'thinks' so I guess it's running the flow, but the false just changes to 'true'. There's no JSON data returned? testing the flow works fine. Any ideas?

5 REPLIES 5
v-yamao-msft
Community Support
Community Support

Hi @jamesmatson,

 

It seems that you are trying to register the ASP.NET Web API in Microsoft Flow.

How is the Web API created?

Is the flow triggered by a PowerApps button? Please share more details on the flow configuration.

Here is a doc on creating a custom connector for a Web API, this tutorial shows you how to register the API and connect to it and call it from your flow. Please check it for more details:

https://docs.microsoft.com/en-us/connectors/custom-connectors/create-web-api-connector

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I am using Microsoft Flow to call a Web API that i've written. The Web API returns data as JSON arrays. The flow then uses the Request / Response action to provide the JSON back to PowerApps. The flow is called from a PowerApps button. I realise I can create a custom connector, but was hoping this wasn't always required? The FLOW works fine, but the data returned to PowerApps is simply true/false instead of the JSON data set? If required I can post the FLOW JSON and other data if it helps? @v-yamao-msft

Did you ever find solution for this? I have exactly the same issue driving me nuts!

@Chathway I wrote this quite a while ago, and while I know I fixed it, I can't exactly remember what I did, only that I no longer have this issue as I've learned quite a bit. Perhaps if you could post some more information about your issue I could help? E.g. if you're using a custom connector, how are you using it? If you're using Flow, what does your flow look like? What data are you expecting versus what are you getting back and so on.  I have been able to get complex JSON back into PowerApps from a variety of sources, so it's definitely possible. Keep at it! 🙂

Thanks @jamesmatson. I really like powerapps + flow combo but very new to all this and seem to be piecing it together from forums at moment!

 I am trying to get data from the Office 365 Service Communications API , only Get nothing too complex!  I have set the required Azure AD app and can successfully get data using postman.

 Initially I setup a flow (triggered from button press) to get the "/CurrentStatus" data using HTTP with Azure AD Oauth and then do a HTTP respond to powerapps with that data.  I used a copy of my response to create a schema however, I couldn't register the flow in powerapps because of a "registerating error".  After troubleshooting that I discovered that the schema generator had left some blank types in the schema so filled them in and was able to register the flow.  When I trigger the flow all seemed fine but the only data returned would be boolean "True".  I worked around this issue by using flow to create an array from the parsed json http response and then responding to powerapps using that which worked fine.

 Moving on to getting data from "/Messages" I used the same setup as before however, this time need to 2 loops as there was a nested json array in the response.  That setup works fine but the process takes too long to create the response array and the HTTP requested times out before its finished! I tried to use the api filter to narrow down the response but that doesn't work as referenced in the API's reference (I commented on Github).

 So I went back to just trying to send the whole Get response to powerapps and then I could filter out the response in powerapps and this is where I am stuck.  I think the problem is with them schema but no matter what I try I either get back nothing or value "True".

  Done a bit more digging into custom connectors this weekend and have managed to setup a custom connector for this api and successfully get back the data so I'm thinking that's the way to go? not flow?  Although if you have any ideas why my flow not working I would be interested to hear Smiley Happy I can send screenshots of my setup tomorrow when I back in work.

 

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,907)