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

How to convert string of properties into an object?

Below the snippet is my Input. (Array of objects)

 

[
{"propName":"Prop1","propValue": "Prop1_Value"},
{"propName":"Prop2","propValue": "Prop2_Value"}
]

 

The final result should be like this object. [Output] (A single object with multiple properties)

 

{
"Prop1":"Prop1_Value",
"Prop2":"Prop2_Value"
}

 

I am able to convert the input object to strings(a string of properties) like below. But I don't know how to proceed further.

 

"{\"Prop1\":\"Prop1_Value\",\"Prop2\":\"Prop2_Value\"}"
"{Prop1:Prop1_Value,Prop2:Prop2_Value}"

 

Here the restriction is, I should not use any variable to iterate the input.
Can someone guide me to get an output for this scenario?

2 REPLIES 2
Paulie78
Super User
Super User

You can use the json() function to convert a string into a JSON. But you're going to need some quotes around the Properties.

Could you please elaborate on how to use join to create JSON object here?

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 (2,819)