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
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,283)