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 Apps / Create a collection us...
Power Apps
Unanswered

Create a collection using the choice field, a text field and specific to user

(1) ShareShare
ReportReport
Posted on by 121

I am trying to create a collection which is taking 3 columns from my SharePoint List,

 

I want a column which contains text, one that contains a choice and the 3rd is the default user email,

 

I am using the following 

ClearCollect(colChoices,ShowColumns(CLUserRoles,Email,GRS,AppRole))

 

I capture all the data but have 2 problems, 1 the AppRole column is a choice field and just displays [Record] in all the rows and not the actual data, 2 i capture all the records and not just the ones for the user. 

 

I've played with,

'Created By'.Email=User().Email

But not sure where it fits within the code.

 

Cheers

 

Categories:
  • ivan_apps Profile Picture
    2,189 Moderator on at

    For issue #1:

    choices in sharepoint are a record in the following format: { Value: “choicetext” }
    so to display the selected app role, simply do this: AppRole.Value

     

    Issue #2.

    Assuming you want to show only rows where the logged in user’s email equals the “Email” column, use this in your filter for your collection: Email = User().Email

     

    your collection should be something like:

    ClearCollect(colChoices, ShowColumns(

    Filter(CLUserRoles, Email=User().Email), Email,GRS,AppRole))

  • Markswan20 Profile Picture
    121 on at

    Thanks for the quick reply,

     

    #2 is sorted thank you 

    #1 contains an error, i originally tried .Value but doesn't work it gives me the red line underneath, i used the following

     

    ClearCollect(colChoices, ShowColumns(
    
    Filter(CLUserRoles, Email=User().Email), Email,GRS,AppRole.Value))
  • ivan_apps Profile Picture
    2,189 Moderator on at

    When you do a ShowColumns() the column name must match the AppRole column name.

     

    Only when you decide to display it - like in a gallery - add a text label and reference:

     

    ThisItem.AppRole.Value

     

    to see the text.

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Markswan20 ,

    Firstly your filter

    ClearCollect(
     colChoices,
     ShowColumns(
     Filter(
     CLUserRoles,
     'Created By'.Email = User().Email
     ),
     Email,
     GRS,
     AppRole
     )
    )

    To display the AppRole, you need

    ThisItem.AppRole.Value

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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 Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard