Reputation: 404
I have an action call on my custom connector that returns JSON with data:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(mail,displayName,department)/$entity",
"mail": "[email protected]",
"displayName": "First Last",
"department": "DPE-DES-Platform Services"
}
I want to parse this response and store 'department' into a variable that I can use for another action call as a parameter. How would I do this? Sorry if this is elementary, I'm very new to PowerApps.
I have like 10 calls I need to make with graph API and I only want to display the end result, so I need some way to store information into variables. If there was some way I could interact with the information through code that would be great, because I also need to do things like create data structures and modify variables if possible
Upvotes: 1
Views: 1797
Reputation: 4365
You might try using dot (.
) notation on the end of your Custom Connector call. Depending on the shape of the actual response, you can parse out a value that way.
Something like:
Set(varDept,
ccCall.GetDept({whatever:criteria}).department
)
Upvotes: 0
Reputation: 11401
There is currently no way to directly parse the JSON response in Powerapps . You can use Powerapps with Power automate to parse the JSON response by using Action “Parse JSON”
.
Reference: Solved: Parse JSON string in Power APPS - Power Platform Community (microsoft.com)
For the feature you can also upvote the feature request here : Parse JSON in PowerApps - Power Platform Community (microsoft.com)
For more details on Powerapps : Microsoft Power Apps documentation - Power Apps | Microsoft Docs
Upvotes: 2