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!
Solved! Go to Solution.
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":',''),'}','')
Try this:
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":',''),'}','')
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.
@radityoardi that’s what I showed in my answer. But perhaps I didn’t make it clear enough.
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
87 | |
85 | |
51 | |
48 | |
39 |