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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (2,760)