Skip to main content

Notifications

Community site session details

Community site session details

Session Id : EBjIwy4rwoiTBz9VVFfw13
Power Automate - Using Connectors
Answered

Returning JSON Array to Power Apps

Like (0) ShareShare
ReportReport
Posted on 9 Sep 2021 00:25:30 by

I am new to the power platform however I have managed to perform an get API call via Automates "HTTP" step.

I have a Http response from this as follows:

 

 

 

[
 {
 "id": 793272,
 "summary": "Create Network map",
 "recordType": "ServiceTicket",
 "board": {
 "id": 1,
 "name": "Service Desk"
 },
 "status": {
 "id": 591,
 "name": "Assigned Unscheduled"
 }
 },
{
 "id": 793273,
 "summary": "Create Network map2",
 "recordType": "ServiceTicket",
 "board": {
 "id": 1,
 "name": "Service Desk"
 },
 "status": {
 "id": 591,
 "name": "Assigned Unscheduled"
 }
 }
]

 

 

 

 So far so good. If I wanted to return this data (or at the very least id, summary and recordtype) to a canvas app and use it to populate a collection with columns. How do I do this?

 

Currently I have a "Respond to Powerapp or flow" step that returns and escaped Json string ie: 

 

 

 

"output": "[{\"id\":793272,\"summary\":\"Create Network map\"...

 

 

 

 The call to automate in Powerapps is constructed as follows: 

 

 

 

Set(id,"20960");
Collect(Collection1, GetCWTickets.Run(id))

 

 

 

The collection is returned as a single value and single row. How do I change this to display the id,summary and recordtype as columns? 

 

Collection ContentsCollection Contents

  • FollowTheLion Profile Picture
    52 on 17 May 2023 at 15:12:49
    Re: Returning JSON Array to Power Apps

    This was really helpful to me.  The response can be used directly as a table.  I basically do this:

    Set( objTable, buttonFlow.Run(sInputParameter) );

    And then I have objTable as the Items property of a Gallery object.

    No additional conversion or processing is required.

    This is really useful.

    Thanks.

  • Verified answer
    v-bofeng-msft Profile Picture
    on 15 Sep 2021 at 01:54:51
    Re: Returning JSON Array to Power Apps

    Hi @thecolonel :

    Agree with @annajhaveri ,please use the 'Response' action instead of "Respond to Power app or flow".I've made a test for your reference:

    vbofengmsft_0-1631670681262.png

    Response Body JSON Schema:

    {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "id": {
     "type": "integer"
     },
     "summary": {
     "type": "string"
     },
     "recordType": {
     "type": "string"
     },
     "board": {
     "type": "object",
     "properties": {
     "id": {
     "type": "integer"
     },
     "name": {
     "type": "string"
     }
     }
     },
     "status": {
     "type": "object",
     "properties": {
     "id": {
     "type": "integer"
     },
     "name": {
     "type": "string"
     }
     }
     }
     },
     "required": [
     "id",
     "summary",
     "recordType",
     "board",
     "status"
     ]
     }
    }

    The Result:

    vbofengmsft_1-1631670707166.png

    Best Regards,
    Bof

     

     

     

  • Verified answer
    annajhaveri Profile Picture
    8,531 Most Valuable Professional on 13 Sep 2021 at 08:51:25
    Re: Returning JSON Array to Power Apps

    @thecolonel  use Response action to return the json back to PowerApps. Use following expression in PowerApps to store the json in collection

    ClearCollect(Collection1, GetCWTickets.Run(id))

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,342 Most Valuable Professional

Leaderboard

Featured topics

Loading started