web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create custom JSON fil...
Power Apps
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!

I have the same question (0)
  • AhmedSalih Profile Picture
    6,678 Moderator on at

    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


     

     

  • epwheldo Profile Picture
    6 on at

    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

  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @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

    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! 🙂 

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard