Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

Create custom JSON file from dataverse in canvas app

(0) ShareShare
ReportReport
Posted on by 6

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: 

Default Value null,.png

 

I would like my data to be structured like this:

value Blank,.png

 

 

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!

Categories:
  • epwheldo Profile Picture
    6 on at
    Re: Create custom JSON file from dataverse in canvas app

    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:

    Screen Shot 2022-09-01 at 10.04.15 AM.png

    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:

    {
    "identifier": {
    "description": "",
    "referenceTag": "7yLuYeIO",
    "defaultValue": "",
    "dictionary": [
    {
    "value": "Cover_Assessment_Name_1",
    "resultString": "{{DXWSQFqF.display}} Single-Rater Report"
    },
    {
    "value": "Cover_Assessment_Name_2",
    "resultString": "{{bEq7YQaN.display}} {{DXWSQFqF.display}} Single-Rater Report"
    }
    ]
    },
    "17oqJmO3": {
    "description": "",
    "referenceTag": "omqCPXlg",
    "defaultValue": "",
    "dictionary": [
    {
    "value": "Cover_Child_Gender_1",
    "resultString": "{{DsmqTcAq.display}} ({{sLjRf5PR.display}})"
    },
    {
    "value": "Cover_Child_Gender_2",
    "resultString": "{{DsmqTcAq.display}}"
    },
    {
    "value": "Blank",
    "resultString": ""
    }
    ]
    },
     
    For example, many value/resultStrings may be related to the same referenceTag, and therefore should be located within the same array, while the referenceTag, description, default value, etc. are outside the array.
     
    Thank you so much for your help! 🙂 

     

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Create custom JSON file from dataverse in canvas app

    @epwheldo

    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.

     

     

     

  • epwheldo Profile Picture
    6 on at
    Re: Create custom JSON file from dataverse in canvas app

    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

    image.png

  • AhmedSalih Profile Picture
    6,678 Super User 2025 Season 1 on at
    Re: Create custom JSON file from dataverse in canvas app

    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


     

     

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics