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

Format compose output from array to something readable

Hi,

 

I have a compose connector that has an input of an array of strings. I want to take that array of strings and format it into something more readable like a proper CSV or a table. in an email. An example of the array, shortened considerably:

 

[
  "emailaddress1@redacted.com",
  "emailaddress2@redacted.com",
  "emailaddress3@redacted.com",
}
 
As it stands, if I take the ouput of the compose and put it into an email body, I get a huge run on string like:
 
["emailaddress1@redacted.com","emailaddress2@redacted.com","emailaddress3@redacted.com"]
 
Except much longer with the full input data. I can't figure out how to take that data and split it into something more readable as mentioned before. Ideally I'd have an email body containing:
 
emailaddress1@redacted.com
 
Does anyone know how to do this? I've seen multiple threads here for more complex arrays that require breaking out substrings etc and so the solutions don't work for me.
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Have a look at the following...

 

Remove in - concat code to create new break line in variable 

 

concat()</br>

 

Hope this helps.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Have a look at the following...

 

Remove in - concat code to create new break line in variable 

 

concat()</br>

 

Hope this helps.

at211
Frequent Visitor

Thanks for the response. I tried that, but it doesn't work for me. 

 

When I try to use the Append to string variable, I get the following:

InvalidTemplate. Unable to process template language expressions in action 'Append_to_string_variable' inputs at line '1' and column '22566': 'The template language expression 'concat(items('Apply_to_each_4')?['UserPrincipalName'],'</br>')' cannot be evaluated because property 'UserPrincipalName' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.

 

I have an array of strings already, so I'm not sure why I'd need to select them by property. Clearly I'm missing something.

at211
Frequent Visitor

I just figured it out. The link provided was helpful (thank you to the poster), I just had to modify the expression inside the for each, as below:

 

apply_to_each_append.JPG

 

Hopefully this helps someone else.

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,704)