web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How i can dynamically ...
Power Automate
Unanswered

How i can dynamically build part of a string array inside Compose

(0) ShareShare
ReportReport
Posted on by 3,514

I have this json array which i am passing as part of an http request boy:-

 

johnjohn123_0-1684002618325.png

 

here is the string:-

 

 

 

"peoplePickerInput":"[ { \"Key\":\"@{items('Apply_to_each_-_Certificates_2')?['EmailAddressNo1']}\"},{ \"Key\":\"@{items('Apply_to_each_-_Certificates_2')?['EmailAddressNo2']}\" } ]"

 

 

now i want to build a compose to check if the following is empty:-

 

 

 

@{items('Apply_to_each_-_Certificates_2')?['EmailAddressNo2']}

 

 

and if so to only have one item inside the array:-

 

 

"peoplePickerInput":"[ { \"Key\":\"@{items('Apply_to_each_-_Certificates_2')?['EmailAddressNo1']}\"}]"

 

 

so how i can do this inside compose and pass the output of the compose to the ""Send http request" action ?

Categories:
  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    Use

     

    empty(items('Apply_to_each_-_Certificates_2')?['EmailAddressNo2'])

     

    to construct the string/enumeration either with two addresses or with one address.

  • johnjohn123 Profile Picture
    3,514 on at

    @lbendlin  Thanks for the reply,, i know about empty function, my concern is about building the array , as you can see it already contain " & \"  so not sure how i can construct the array string inside an expression? any advice?

  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    If you feel uncomfortable doing the string escaping in a Compose action you can use a Control decision action (aka if then else) to handle the two scenarios separately. Maybe you can show what you have tried so far.

  • johnjohn123 Profile Picture
    3,514 on at

    @lbendlin having 2 branches inside a condition will require me to duplicate many steps, as there are many subsequent actions which depend on the result.. so i would better do it inside a compose.. but not sure how i can construct the array string? any advice?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 233 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 136 Super User 2026 Season 2

Last 30 days Overall leaderboard