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 / Nicely format Flows (J...
Power Apps
Unanswered

Nicely format Flows (JSON) when using solutionpackager.exe /action:extract

(1) ShareShare
ReportReport
Posted on by

When "exploding" a solution that contains flows/PowerAutomates the JSON is held on a single line and is hard to diff.

i.e. when a solution contains flows (or SLAs) and the solution is expanded 

SolutionPackager.exe /action:extract /zipfile:CustomSLA_1_0_0_1.zip

The exported flows are not nicely formatted and are very difficult to compare over different revisions of the SLA logic.  One of the key benefits of using the solution packager is change tracing, which is being made much more difficult since the extract flow JSON is in one long line as demonstrated below.    

{"properties":{"connectionReferences":{"shared_commondataserviceforapps":{"runtimeSource":"embedded","connection":{},"api":{"name":"shared_commondataserviceforapps"}}},"definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"},"$authentication":{"defaultValue":{},"type":"SecureObject"}},"triggers":{"[Do not delete or update] Invoked Through Execution Workflow Call":{"type":"OpenApiConnectionWebhook","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"SubscribeWebhookTrigger","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"subscriptionRequest/message":3,"subscriptionRequest/entityname":"slakpiinstance","subscriptionRequest/scope":4,"subscriptionRequest/filteringattributes":"versionnumber,createdon"},"authentication":"@parameters('$authentication')"}}},"actions":{"[Do not delete or update] Switch":{"runAfter":{},"cases":{"[Do not delete] Is Near Non Compliance.":{"case":2,"actions":{"Update_a_record":{"runAfter":{},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"UpdateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"incidents","recordId":"@triggerOutputs()?['body/regardingentityid']","item/pgc_ragfirstresponse":289920001},"authentication":"@parameters('$authentication')"}}}},"[Do not delete] Is Succeeded.":{"case":4,"actions":{}},"[Do not delete]Is Non-compliant.":{"case":1,"actions":{}}},"default":{"actions":{}},"expression":"@triggerOutputs()?['body/status']","type":"Switch"}},"outputs":{}}},"schemaVersion":"1.0.0.0"}

Can the solution packager output formatted JSON that is friendly to read, and more suitable for standard comparison tools (e.g, diff, WinMerge, etc)? e.g.

 

{
 "properties": {
 "connectionReferences": {
 "shared_commondataserviceforapps": {
 "runtimeSource": "embedded",
 "connection": {},
 "api": {
 "name": "shared_commondataserviceforapps"
 }
 }
 },
 "definition": {
 "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
 "contentVersion": "1.0.0.0",

 

I have the same question (0)
  • ScottDurow Profile Picture
    1,039 on at

    afik there is no way to do this by default. I run lots of scripts after the Solution Packager has unpacked the files to make them easier to diff in source control - prettifying JSON is one of the steps. You can do this with the indent argument of :

    https://www.newtonsoft.com/json/help/html/SerializeObject.htm

     

    hope this helps

    Scott

  • Community Power Platform Member Profile Picture
    on at

    Thanks @ScottDurow.  I created a powershell (v6+) script that reformats the JSON.

     

    It would be great if this would be done as standard as part of the solutionpackager.exe /action:extract though. 

     

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard