Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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'], ';')

 

 

  • elshadlive Profile Picture
    15 on at
    Re: How to join non-primitive array values using expression

    @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.

  • v-bacao-msft Profile Picture
    on at
    Re: How to join non-primitive array values using expression

     

    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
    Re: How to join non-primitive array values using expression

    @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?

  • Verified answer
    v-bacao-msft Profile Picture
    on at
    Re: How to join non-primitive array values using expression

     

    Hi @elshadlive ,

     

    Please try the following configuration:

    59.PNG60.PNG

     

    Best Regards,

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1