cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ryan2Work
Regular Visitor

Parse JSON - Dynamic number as object's name

Hello,

I got a piece of JSON code as below, what I need is to gain object's title value into a string. The JSON code I got consists by many objects that object's name is assigned by dynamic number like "79354", "80634" or others. I've tried use Generate from sample to generate JSON schema via PowerAutomate, as expect, it is not work for me because "79354" and "80634" be treated as static string, it cannot handle different object name in next call. Please have a look at it. 

 

I want to go from this:

 

 

{
  "79354": {
    "isChecked": false,
    "title": "Checklist1",
    "lastModifiedBy": {
      "user": {
        "displayName": null,
        "id": "3e618d5b-8691-4013-8619-2c5070981c23"
      }
    }
  },
  "80634": {
    "isChecked": false,
    "title": "Checklist2",
    "lastModifiedBy": {
      "user": {
        "displayName": null,
        "id": "3e618d5b-8691-4013-8619-2c5070981c23"
      }
    }
  }
}

 

 

 to this:

 

 

Checklist1,Checklist2

 

 

 

Any help appreciated.

 

4 REPLIES 4
ChristianAbata
Super User
Super User

hi @Ryan2Work  what I do is recreate my json squema to see someting like this.

{
	"Example": {
		"Name": "79354",
		"Object": {
			"isChecked": false,
			"title": "Checklist1",
			"lastModifiedBy": {
				"user": {
					"displayName": null,
					"id": "3e618d5b-8691-4013-8619-2c5070981c23"
				}
			}
		}
	},
	"Example1": {
		"Name": "79354",
		"Object": {
			"isChecked": false,
			"title": "Checklist2",
			"lastModifiedBy": {
				"user": {
					"displayName": null,
					"id": "3e618d5b-8691-4013-8619-2c5070981c23"
				}
			}
		}
	}
}

 

Then as you can se I can use the object name as diferents. I'm going to work in a function do to that but this only can works if you basic squema don't change.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
efialttes
Super User
Super User

@Ryan2Work @ChristianAbata 

Very interested to see if there is a reasonable workaround. I faced exactly the same problem when reading data from Firebase, and I finally found no other way but to change Firebase data model 😞

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Ryan2Work
Regular Visitor

@efialttes, @ChristianAbata , thanks for your comments.

Unfortunately, it is not be considered to change original JSON schema by data provider. So, I'm really looking forward to someone's help. 

@Ryan2Work  you can change it in your flow give time I'll try some things.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,948)