Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Display choice column values from all rows

Posted on by 130

I have 3 rows in my sharepoint list having one choice column in which there are multiple values..

I want to show all choice column values from all rows in a text label separated by space.

choiceError.PNG

I tried:  "  Left( Concat( LookUp(phasecc,UserID=TemplateGalleryList1.Selected.'User ID' ).Class,Value & Char(10 )) , Len( Concat( LookUp(phasecc,UserID=TemplateGalleryList1.Selected.'User ID' ).Class,Value & ", " ) ) -1)  "

 

where class is choice column

 

but I'm getting only first row values not from all rows.

 

Thanks

 

Any help will be much appreciated.

  • r_voyager Profile Picture
    r_voyager 130 on at
    Re: Display choice column values from all rows

    Thanks @Anchov . It worked.

  • Verified answer
    Anchov Profile Picture
    Anchov 1,951 on at
    Re: Display choice column values from all rows

    I think the issue is with using a Lookup, as a lookup will only ever return one record at a time.  I tried doing this with a filter function, but then I just has a table of tables.  I had to "flatten out" the table like this (done with a button, OnSelect):

    Clear(colFlat);
    
    ForAll(Filter(Demo.MultiChoices, !IsEmpty(MultiChoices)), Collect(colFlat, ThisRecord.MultiChoices.Value)); // You filter would be on the unique user id, in this example I am i am just filtering out items without any choices
    
    ClearCollect(colFlat, Distinct(colFlat, Value)) //this is just filtering out duplicates, may not be neccesary in your case.

     

    Then my label (Text) looks like:

    Concat(colFlat, Result, ",")

     

  • r_voyager Profile Picture
    r_voyager 130 on at
    Re: Display choice column values from all rows

    I'm trying to span multiple Sharepoint rows (with the same User). 

     

    Using this formula : "  Left( Concat( LookUp(phasecc,UserID=TemplateGalleryList1.Selected.'User ID' ).Class,Value & Char(10 )) , Len( Concat( LookUp(phasecc,UserID=TemplateGalleryList1.Selected.'User ID' ).Class,Value & ", " ) ) -1)  "

    Attached the output..outC.PNG

     

    But I should get all the Classes shown in question..I'm only getting first row values..

  • Anchov Profile Picture
    Anchov 1,951 on at
    Re: Display choice column values from all rows

    @r_voyager , I don't think that would matter, are you trying to span multiple SharePoint rows (with the same User) or multiple class choices in the same SharePoint row?

    Are you getting a formula error?  Are you ablet to share a screenshot of what you are seeing?

  • r_voyager Profile Picture
    r_voyager 130 on at
    Re: Display choice column values from all rows

    Hi,

     

    Thanks for your reply but it's not working.

     

    Actually, earlier this was a single line text column, I converted it to a choice column. Can this be a reason?

  • Anchov Profile Picture
    Anchov 1,951 on at
    Re: Display choice column values from all rows

    Have you tried something like this?

     

     

    Concat(Filter(phasecc, UserID = TemplateGalleryList1.Selected.'UserID').Class, Value, ",")

     

    Example:

    Anchov_0-1670874477611.png

     

     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard