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

Convert one property of array of object to string

Hello, 

I'm in trouble, i have this input :

 

[
  {
    "mail": "123@mail.com"
  },
  {
    "mail": "456@mail.com"
  }
]

 

And i want this output for send mail later:

 

"123@mail.com;456@mail.com"

 

but i can't use variable, only compose because i'm in a each loop parallel 😕 (hope it's can work in this context with compose)

2 ACCEPTED SOLUTIONS

Accepted Solutions
DamoBird365
Microsoft
Microsoft

Hi @Alhoa 

 

Are there just two emails?

 

They could be called by variables('Array')?[0]?['mail'] and variables('Array')?[1]?['mail']

note i have used a variable called array to test this and you would replace with your source.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

Hi @Alhoa 

 

Alternatively you can create a string variable to hold your emails in and simply use an apply to each to append each to the string as follows:

 

DamoBird365_0-1615994325041.png

 

Where the formula is:

items('Apply_to_each')?['mail']

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

 

 

View solution in original post

3 REPLIES 3
DamoBird365
Microsoft
Microsoft

Hi @Alhoa 

 

Are there just two emails?

 

They could be called by variables('Array')?[0]?['mail'] and variables('Array')?[1]?['mail']

note i have used a variable called array to test this and you would replace with your source.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

Hi @Alhoa 

 

Alternatively you can create a string variable to hold your emails in and simply use an apply to each to append each to the string as follows:

 

DamoBird365_0-1615994325041.png

 

Where the formula is:

items('Apply_to_each')?['mail']

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

 

 

DamoBird365
Microsoft
Microsoft

HI @Alhoa 

 

How are you getting on?

 

Damien

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (5,440)