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 Contents
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.
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:
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:
Best Regards,
Bof
@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))