cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sasrsc1966
Resolver I
Resolver I

Extracting the Display Name for a Json text/string value...from a Multiple Person Column

ForAll(
    GalRequests.AllItems,
    Collect(
        itemsForCsv,
        {
            ID: ThisRecord.ID,
            Contacts: ThisRecord.Contacts.DisplayName
        }
    )
);

 

I am creating a collection that I will convert to JSON for a user to be able to Export to a CSV (using Flow). 

My question is that ThisRecord.Contacts is a multiple person column in SP.

In my ForAll (which is looping through my Gallery Items) I need to produce a "Contacts:" object containing the DisplayNames of each person but stored as a single string. Just not sure how to do this syntax.

So hence the result would be etc....
"Contacts": "Batman, Mickey Mouse, Freddie Mercury" 


1 ACCEPTED SOLUTION

Accepted Solutions

Thank you @BCLS776 .. that got me headed in the right direction... 

The correct answer was ...

Contacts: Concat(ThisRecord.Contacts.DisplayName,DisplayName,", "),



and here it is in the entire onSelect property...

ForAll(
    GalRequests.AllItems,
    Collect(
        itemsForCsv,
        {
            ID: ThisRecord.ID,
            Title: ThisRecord.Title,
            Status: ThisRecord.Status,
            Contacts: Concat(ThisRecord.Contacts.DisplayName,DisplayName,", "),
            DateTimeUTC: ThisRecord.'Air Date Time',
            WebinarDateTime: Text(DateTimeValue(ThisRecord.'Air Date Time'),DateTimeFormat.ShortDateTime),
            WebinarDate: Text(DateTimeValue(ThisRecord.'Air Date Time'),DateTimeFormat.ShortDate),
            Duration: ThisRecord.Duration,
            Sector: ThisRecord.'Sector Target',
            'Key Focus': ThisRecord.'Key Focus',
            Format: ThisRecord.'Format Options',
            CreatedBy: ThisRecord.'Created By'.DisplayName,
            ModifiedBy: ThisRecord.'Modified By'.DisplayName,
            Created: ThisRecord.Created,
            Modified: ThisRecord.Modified


        }
    )
);
Notify(
    "An Excel file is being created. It will save on your OneDrive location",
    NotificationType.Information,
    3000
);
Set(
    fileOpen,
    ExportToExcel.Run(
        JSON(
            itemsForCsv,
            JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes
        ),
        "Webinars"
    ).filelink
);
Launch(fileOpen);
Clear(itemsForCsv);

 

View solution in original post

2 REPLIES 2
BCLS776
Super User
Super User

Try:

Contacts: Concat(ThisRecord.Contacts.DisplayName,", ")

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Thank you @BCLS776 .. that got me headed in the right direction... 

The correct answer was ...

Contacts: Concat(ThisRecord.Contacts.DisplayName,DisplayName,", "),



and here it is in the entire onSelect property...

ForAll(
    GalRequests.AllItems,
    Collect(
        itemsForCsv,
        {
            ID: ThisRecord.ID,
            Title: ThisRecord.Title,
            Status: ThisRecord.Status,
            Contacts: Concat(ThisRecord.Contacts.DisplayName,DisplayName,", "),
            DateTimeUTC: ThisRecord.'Air Date Time',
            WebinarDateTime: Text(DateTimeValue(ThisRecord.'Air Date Time'),DateTimeFormat.ShortDateTime),
            WebinarDate: Text(DateTimeValue(ThisRecord.'Air Date Time'),DateTimeFormat.ShortDate),
            Duration: ThisRecord.Duration,
            Sector: ThisRecord.'Sector Target',
            'Key Focus': ThisRecord.'Key Focus',
            Format: ThisRecord.'Format Options',
            CreatedBy: ThisRecord.'Created By'.DisplayName,
            ModifiedBy: ThisRecord.'Modified By'.DisplayName,
            Created: ThisRecord.Created,
            Modified: ThisRecord.Modified


        }
    )
);
Notify(
    "An Excel file is being created. It will save on your OneDrive location",
    NotificationType.Information,
    3000
);
Set(
    fileOpen,
    ExportToExcel.Run(
        JSON(
            itemsForCsv,
            JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes
        ),
        "Webinars"
    ).filelink
);
Launch(fileOpen);
Clear(itemsForCsv);

 

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.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,769)