web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building 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

 

I have the same question (0)
  • ivan_apps Profile Picture
    2,187 Moderator on at
    Re: Create a collection using the choice field, a text field and specific to user

    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
    Re: Create a collection using the choice field, a text field and specific to user

    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,187 Moderator on at
    Re: Create a collection using the choice field, a text field and specific to user

    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
    151,881 Most Valuable Professional on at
    Re: Create a collection using the choice field, a text field and specific to user

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 663 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 398 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 235

Last 30 days Overall leaderboard