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 to join non-primit...
Power Automate
Answered

How to join non-primitive array values using expression

(0) ShareShare
ReportReport
Posted on by 15

Hi,

An "Employees" field from Sharepoint list returns an array of JSON datatype, as follows:

 

[{
 "DisplayName": "John Doe",
 "Department": null,
 "JobTitle": null
}, {
 "DisplayName": "Mary Jane",
 "Department": null,
 "JobTitle": null
}]

 

In the next step, this field value inserted in Excel.

What I need is to join in one string only DisplayName values separated by a semicolon, like: "John Doe, Mary Jane"

I am able to get DisplayName value using index numbers:

 

triggerBody()?['Employees'][0]?['DisplayName']
// returns: John Doe

 

I can also concatenate several array indexes, but I don't know in advance how many elements will be in an array.

How can I join values from an array using expressions (formulas) only? Maybe some additions to join function will help? I tried the next one, but it didn't work

 

join(triggerBody()?['Employees']?['DisplayName'], ';')

 

 

Categories:
  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @elshadlive ,

     

    Please try the following configuration:

    59.PNG60.PNG

     

    Best Regards,

  • elshadlive Profile Picture
    15 on at

    @v-bacao-msft thank you for your reply.

    Can I do the same without using Activities, but using WDL inline expressions instead? I am not familiar with WDL and not sure if there is some iteration operator.

    I have about 30 columns from Sharepoint list, which must be read and then mapped (written) to Excel sheet. The field in a subject is only one of multiple array fields. Creating multiple Activities for each of those fields will be a nightmare.

    So, I am looking for a solution of converting multi-valued arrays to strings on mapping level for each field.

    fieldsList.png

    Assuming that I have to make different conversions and calculations on most of these fields I'd be grateful if you could suggest "coding way" of manipulating data instead of using Activities (of course within possibilities of the platform).

    On top of my mind I am thinking about something like:

    join(createArray(triggerBody()?['Employees'](ApplyForEachOperator)['DisplayName']), ';')
    or
    triggerBody()?['Employees'](SelectFunction)['DisplayName']
    
    // triggerBody()?['Employees'] is my array field

    where ApplyForEachOperator and SelectFunction keywords are iteration or selection operators

    Any suggestions?

  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @elshadlive ,

     

    Unfortunately, as far as I know, the WDL function does not contain a function can be used to iterate items in an array.

    So we only can use Apply to each to iterate items in Power Automate.

     

    Best Regards,

  • elshadlive Profile Picture
    15 on at

    @v-bacao-msft thanks for the reply. I'll dig deeper and look for a maximum minimalistic solution. I'll post here if any success.

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard