cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerBytes
Frequent Visitor

Parse Json properties and values without schema

Hello,

I'm trying to parse this kind of json data to store it in database. Problem is that json presents questions and replies to those. Questions could change without prefer notice and also amount of questions in json could also vary.

Example:

{"Question 1":"Reply to question 1","Question 2":"Reply to question 2","Additional question":"Reply to additional question"}

 

How could I iterate/loop this content so that I could save it to database? My problem is that I could not use normal "parse json", as questions could change any time.

 

Any hints how to start resolving this appreciated!

4 REPLIES 4
Pstork1
Dual Super User
Dual Super User

  1. Manipulate the string to remove the leading and trailing braces
  2. Split the string into an array on the comma seperators
  3. Each array entry can now be seperated out into a question, what is before the ':' and an answer, everything after the ':'


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi Pstork1

 

Thanks for and excellent idea! Anyhow trying this I ended up in trouble, that those reply datas are free text and they contain commas and colons. So when I split string with comma separators, results could be unwanted.

 

Like this Question 1 would split between Yes and I:

{"Question 1":"Yes, I want to do that","Question 2":"Reply to question 2","Additional question":"Reply to additional question"}

 

Same trouble if there appear colons.

Can you try replacing the ", with a different character like "|.  That should avoid the embedded commas in the values.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thank you for hints again, but I end up in troubles in any way I think.

It seems, that numeric response values are not in "", like:

"How much?":9,"Next question"...

There might also be : in field values, like:

"Free text":"The thing is: I think that this is not working"...

 

Full example:

{"Rating 1-10?":8,"Question 2":"Reply to question 2","Additional question":"Response is: here"}

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (4,337)