cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CABIRD
Post Patron
Post Patron

Flow Parse JSON use a sample payload to generate schema

Hello

I've looked for training module to generate 'Flow' JSON scheme. While I have successfully built Flows with JSON it's more a hit and miss implementation. The principal reason my understanding at this moment in time is inadequate as to how to generate a schema correctly. 

 

Is there any step by step training available?

 

Regards

Christopher

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi

 

If you are following Paul's video at about 4:15 he shows what he is sending to the Flow from PowerApp.

jsonflow answer.jpg
So using this as an example a sample payload for this would be

{"FileName":"aaa","File":"aaa"}

I put the names within quotes and I put example data in, eg the "aaa" is just to show the data will be a string.
 
So in the Parse JSON Action I click on Use Sample Payload to Generate schema and paste the above string in and then click Done. That should generate the schema for you.

Hope that helps.
 
Laura GB
 

View solution in original post

16 REPLIES 16
LauraGB
Kudo Kingpin
Kudo Kingpin

No obvious posts or blogs come to mind.

 

You could add a topic suggestion for the blog authors to take on at https://powerusers.microsoft.com/t5/Community-Blog-Topic-Suggestions/idb-p/BlogTopicSuggestions

 

Laura GB


faustocapellanj
Memorable Member
Memorable Member

Hi @CABIRD 

The Flow Nijna @Anonymous has a blog post about the Parse JSON action. He provides an excellent overview and several approaches to work with it. I suggest you check it out and try to implement it in your Flow. Please do not hesitate to reach out if you have questions.

http://johnliu.net/blog/2018/6/a-thesis-on-the-parse-json-action-in-microsoft-flow

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Hello @faustocapellanj 

 

Thank you for taking the time to reach out with an answer. I really appreciate you doing so.

 

As always John Liu article is excellent.

 

My biggest problem is 'how to get the sample payload to paste into the schema.'
 
Example Flow structure.

 

A Power App trigger, initialise variable, Parse JSON.

 

Try to save the Flow to run and you cannot save so cannot run generate the sample schema.  If there is no parse Json trigger how is the schema generated i.e. where is the scheme to copy and paste.

 

I included an image of a succussful Flow but this is after much trial and tribulation (created the scheme myself). There simply must be knowlege missing in my understanding.

 

Schema.png

 

Ideally a step by step illustrative guide would be helpful i.e. removes any ambugities and makes no assumptions as to user understanding.  Searching the internet I know I'm not the only one frustrated with the quote 'run the Flow to generate JSON scheme.'

 

Thank you and have fabulous day.

 

 

 

So, one thing I do is that I add the trigger and an action, and once the Flow is done running, I check the run history to get the body output. I then copy that information, add a Parse JSON action, click on Generate schema from sample payload and paste the body output I copied from the trigger or the next action. This generates the schema.
Please let me know if this helps answer your question.
Thanks.
Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Hello @faustocapellanj 

 

Thank you for replying promptly.

I added the following

  • Trigger PowerApps
  • Initialise variable

Run the Flow prior to adding Parse JSON

See images below.

Trigger.png

Run History below

output.png

No output to copy and paste.

 

Hopefully the above illustrates my issue. Thank you. 

 

 

What are you sending from PowerApps to Flow?
Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

variable.png

I have a button. The button initiates Flow. Flow opens, I added an action. Save the Flow. From Flow I clicked Run and the above opens. I typed in hello.jpg. 

 

I have built an app that works but that was tortious process to state the least as I had to build the schema myself. I have the Flow upload audio, files, photos, pdf metadata to SharePoint. I begin with a PowerApp trigger then my action initialise variable, then Parse JSON, SharePoint Create File, Update file Properties. 

 

Obiviously I cannot add Parse JSON and save an run. 

 

So how do I get the generate JSON schema function to create the schema? 

 

Thank you. 

Here's a video that Paul Culmsee did on that:

https://www.youtube.com/watch?v=kQVYid1p_vA&t=254s

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Hello @faustocapellanj 

 

Thank you for forwarding the video. 

 

Let me repeat I have a Flow that works for all the features Paul's video illustrates. I just don't want to have to tediously build a schema each time if there is an approved methodogly. 

 

The issue is how do I generate the JSON scheme. The how is not explicitly shown in the video. Paul mentions running the Flow to generate the Scheme. However, you cannot generate output from PowerApp trigger and Initialise Variable alone to create JSON scheme.  

 

So, the question remains. How do I generate the output that enables me to paste schema into the generate JSON scheme?

 

Clearly, I’m missing something in my understanding.

Hi

 

If you are following Paul's video at about 4:15 he shows what he is sending to the Flow from PowerApp.

jsonflow answer.jpg
So using this as an example a sample payload for this would be

{"FileName":"aaa","File":"aaa"}

I put the names within quotes and I put example data in, eg the "aaa" is just to show the data will be a string.
 
So in the Parse JSON Action I click on Use Sample Payload to Generate schema and paste the above string in and then click Done. That should generate the schema for you.

Hope that helps.
 
Laura GB
 

Hello @LauraGB 

 

Thank you. 

 

I assume the generated schema is correct although the "type" would need to change to "File" etc. to have relevance to further Flow development. 

 

{
    "type": "object",
    "properties": {
        "type": {
            "type": "string"
        },
        "properties": {
            "type": "object",
            "properties": {
                "FileName": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string"
                        }
                    }
                },
                "File": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    }
}

Thank you. 

 

Regards

Christopher

Hi @CABIRD 

The JSON schema doesn't have a File type. If the goal is to send info from PowerApps to Flow to create a file, at the 3:50 marker of Paul's video, you can see that File is of String type. Also at that point, you can see that he wraps in the File property from the Parse JSON action inside a dataUriToBinary() expression so that can be the file content. Please check out the screenshot I attached.Untitled.png

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Hello @faustocapellanj 

 

Thank you.

 

I have a working Flow. My issue was I didn't want to spend days at some point in the future having to manually create a new schema for a new Flow because I couldn't Parse JSON correctly. 

 

The dataUriToBinary() expression isn't a problem provided the Parse JSON schema is correct. 

 

I really appreciate your help resolving this. Thank you. 

 

Regards

Christopher

@CABIRD I totally hear you. When you have a chance, take a look at the PowerApps JSON function. It's actually so much easier to build your JSON in PowerApps and just send that as a single parameter to Flow.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-json

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Hello @faustocapellanj 

 

Thank you. 

 

Clear documentation with examples. 

 

Best wishes

Christopher

Madiko
Helper I
Helper I

did you find a solution? I have the same issue and posted here: https://powerusers.microsoft.com/t5/General-Power-Automate/Issue-with-JSON-PARSE/td-p/1291942

 

Can anyone help me?

Helpful resources

Announcements

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (5,799)