Skip to main content

Notifications

Community site session details

Community site session details

Session Id : +T/lxfg7B7zGrhrWTtxv8X
Power Apps - Building Power Apps
Answered

How to show the get API data and show it in Power Apps

Like (0) ShareShare
ReportReport
Posted on 3 Apr 2024 07:11:22 by 82

I am creating a flow where I am getting the data from API in JSON format. I now want to display some of this data inside the canvas app. I am using response to send the data to canvas app. I am trying to populate the fields on button click but it is showing up blank

Categories:
  • v-yueyun-msft Profile Picture
    on 03 Apr 2024 at 09:08:59
    Re: How to show the get API data and show it in Power Apps

    Hi, @Ameen1989 

    It depends on what data you want to get in the Power app, if you want all the data, you can pass your body('HTTP') to the Power app.

    Similarly, you can use formulas to extract the text you want and pass it to PowerApp.

     

    And you can also share your output of your http action and what the data you want to get in your Power App .

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

  • Ameen1989 Profile Picture
    82 on 03 Apr 2024 at 09:04:36
    Re: How to show the get API data and show it in Power Apps

    What did you write in the response to power app or flow function body?

  • Verified answer
    v-yueyun-msft Profile Picture
    on 03 Apr 2024 at 08:40:26
    Re: How to show the get API data and show it in Power Apps

    Hi , @Ameen1989 

    Oh... This error code "JSON parsing error, expected object and got an error" seems to happen in your flow side . And you do not need to use the Parse Json action in flow. But you need to add the "Response to a Power App or flow" action in the last of your flow.

    vyueyunmsft_0-1712133451331.png

     

    vyueyunmsft_1-1712133576689.png

    So that you can use this code in Power App.

    Reponse is the parameter name you can see in my screenshot.

    Set(MyAPIData, APIDATA.Run(cityName.Value).Reponse);

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

  • Ameen1989 Profile Picture
    82 on 03 Apr 2024 at 08:26:55
    Re: How to show the get API data and show it in Power Apps

    Yes I am calling the flow in power app. I am using the weather API to get the data. I am using the HTTP response Get method and passing the URI, after that I am using the Parse JSON and then the Response, to show only selected variables.

    I am calling this flow in power apps. I am using a button and on click on I want to populate fields(lbl or input fields) with the data.

    I am confused on what function I should write to get the data. For example, I am using this in the button OnSelect

    Set(MyAPIData, APIDATA.Run(cityName.Value));

    APIDATA = name of the powerflow
    cityName = name of the input field.

    But when I run the app and click on the btn I get this error
    JSON parsing error, expected object and got an error

    I also tried using Collect but get the same error.

    So, how can I display the data in power apps canvas. BTW I am doing this in MS teams
     
     
     
  • v-yueyun-msft Profile Picture
    on 03 Apr 2024 at 07:15:22
    Re: How to show the get API data and show it in Power Apps

    Hi , @Ameen1989 

    Do you mean you call the flow in Power App and you want to get the response from the flow ?

    If this , can you give me the response output in your side ? And also you can try to use the ParseJson() function.

    ParseJSON function - Power Platform | Microsoft Learn

     

    Best Regards,

    Yueyun Zhang

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard