cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Koenti007
New Member

Fastest way to join single property of object array into a string

Hi,

I have an object array eg:

[

{"title": "10","label": "Label10"},
{"title": "11","label": "Label11"}
]

 

What is the fastest way (less actions the better) to obtain a string variable composed of all Label properties eg 'Label10,Label11'?

Thx!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

The best I can come up with is 2 actions (assuming you've already done a Parse JSON)

1) A data Select statement to create an Array with only the Label properties in it

2) A Compose that uses three nested functions.  A Join to create a String from the Array, then a Replace to remove the beginning of the record and key, and finally a Replace to remove the trailing record indicator.

Replace(Replace(join(body('Select'),','),'{"label":',''),'}','')

image.png



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

View solution in original post

4 REPLIES 4
Paulie78
Super User III
Super User III

Try this:

Paulie78_0-1613431547887.png

 

Pstork1
Dual Super User III
Dual Super User III

The best I can come up with is 2 actions (assuming you've already done a Parse JSON)

1) A data Select statement to create an Array with only the Label properties in it

2) A Compose that uses three nested functions.  A Join to create a String from the Array, then a Replace to remove the beginning of the record and key, and finally a Replace to remove the trailing record indicator.

Replace(Replace(join(body('Select'),','),'{"label":',''),'}','')

image.png



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

View solution in original post

Your answer could've been perfect if you click at this button (red circle). It will replace the interface from "key-value" pair to direct value instead. And you don't need the next Compose action.

I have just found out this.

 

2021-03-03_20-09-15.png

Paulie78
Super User III
Super User III

@radityoardi that’s what I showed in my answer. But perhaps I didn’t make it clear enough. 

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

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

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (38,999)