Hello,
I'm currently creating a power app. The user fills out 2 separate forms (multiple times) and all data is added to a collection. This is all done using dataverse.
The end goal of this app is to create a button that converts the whole collection into a customized JSON file. I think this can be done using either built-in power apps JSON functionality or use parse JSON power automate flow to format the schema.
The problem I'm having is when I convert the data into JSON, the file isn't in the right format. It puts all the data into an array but I would like some of that data to be located outside the array. I'm currently using Set(varJSON,JSON(collection,JSONFormat.IndentFour))
For example, the current way my data looks is something like this:
I would like my data to be structured like this:
The 7 letter identifier, description, reference tag, and default value are all in the same table.
The referenceTag, value, and result string are all in another table.
Again, the end goal is to have a JSON file that looks like the picture above from user inputted data in dataverse, or a collection.
Thank you so much in advance!
Hi @Mira_Ghaly
Thanks for your response, I would really appreciate your help. I am unfamiliar with the concept of a collection inside a collection so I would love some guidance.
My current collection looks like this:
and the JSON sample (from collection) I'm using is as follows:
[ {
"Default Value": null,
"Description": null,
"Enrichment": "Test Enrich",
"referenceTag": "TEST ID"
},
{
"Default Value": "TestNewDefault",
"Description": "TestNewDescription",
"Enrichment": "Test Enrich",
"referenceTag": "TestNewID"
},
{
"Default Value": "TestDV2",
"Description": "TestDescription2",
"Enrichment": "Test Enrich",
"referenceTag": "TestNew2"
},
{
"Value": "Test 3",
"referenceTag": "TEST ID",
"resultString": "Test 4"
},
{
"Value": "Test 1",
"referenceTag": "TestNewID",
"resultString": "Test 2"
}
]
I would like my JSON file to be created from this schema:
If I understand correctly and according to the error message you are having the problem looks like in the input you are passing from the powerapps to powerautomate.Looks like you need to construct a collection inside a collection, something like array of arrays.
Can I please ask you to provide here sample of your JSON you are passing to power automate and your schema. So I can try to replicate.
Hi @AhmedSalih
Thanks for your response.
The parsing isn't the end goal, I need to create the JSON automatically and format it. I'm okay with using Power Automate/Flow and not just Power Apps, I just need to find a way to get it done. Not exactly sure how I would accomplish this using flow.
Please advise further if possible, I can provide more information if necessary.
Thanks
Hello, @epwheldo , I am not sure if you can parse the json in powerapps at this time but according to this post which was in 2019, it is not possible or at least not easy. https://powerusers.microsoft.com/t5/Building-Power-Apps/Parse-JSON-string-in-Power-APPS/td-p/381832
What I recommend is to use your desire data structure in the schema of the parse JSON action in power automate and pass the JSONE from the PowerApps to the flow.
If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more. I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends. Visit my Blog: www.powerplatformplace.com
|
mmbr1606
22
Super User 2025 Season 1
stampcoin
17
ankit_singhal
11
Super User 2025 Season 1