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
Community Champion
Community Champion

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (3,987)