Skip to main content

Notifications

Power Automate - Using Connectors
Answered

Returning JSON Array to Power Apps

(0) ShareShare
ReportReport
Posted on 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
    FollowTheLion 52 on at
    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
    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
    annajhaveri 8,531 on at
    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard

Featured topics