cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Transform Data to JSON and then send it to a SQL Table

How can i do this

I used to send the Forms to SQL directly without any intermediate, but now my bosses are asking me
that when de data is send it has to transform to JSON and then send it to an intermediate that transform it again, o now it can be added to the SQL Table.

They say it is for security reasons thta the data must be in JSON format

it can be done with a flow or something like that

7 REPLIES 7
Highlighted
Super User
Super User

Re: Transform Data to JSON and then send it to a SQL Table

There is a built in JSON function that converts objects to JSON. Here is an example of setting a variable to a JSON value of a collection:

 

Set(jsonString,JSON(yourCollection));

 

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up. 

Highlighted
Helper III
Helper III

Re: Transform Data to JSON and then send it to a SQL Table

AND HOW DO I VALIDATE THAT DATA?

Highlighted
Super User
Super User

Re: Transform Data to JSON and then send it to a SQL Table

What do you mean exactly? Like check that it's a valid JSON schema? Or validate that the values are correct?

Highlighted
Helper III
Helper III

Re: Transform Data to JSON and then send it to a SQL Table

Both options

Highlighted
Super User
Super User

Re: Transform Data to JSON and then send it to a SQL Table

I've never run into any reason to doubt the conversion has produced an invalid schema or incorrect values. You can use a validator like the one below to run some tests, but everything should be valid.

https://jsonlint.com/

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Highlighted
Helper III
Helper III

Re: Transform Data to JSON and then send it to a SQL Table

is it possible to validate with a button in powerapps or connect a service to powerapps that validate the JSON

Highlighted
Super User
Super User

Re: Transform Data to JSON and then send it to a SQL Table

I don't know that the JSON() function is capable of producing invalid JSON schemas. I have never had a problme with an invalid schema from the function. To answer your question, there may be a way to validate it using Power Automate, but I'm not sure. You can post that question on their forums here if you'd like

https://powerusers.microsoft.com/t5/General-Power-Automate/bd-p/MPAForum

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,969)