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 / Use Choice/Person fiel...
Power Apps
Answered

Use Choice/Person fields in ShowColumns function

(0) ShareShare
ReportReport
Posted on by 30

Hello Community,

 

Please bear with me as I am new to Power Platform. 

 

My Question is how can we use Choice or Person fields in 'ShowColumns' function in PowerApps?

 

Ex: ClearCollect(collectionA, ShowColumns(Student, "ID", "Name", "Country", "Mentor"))

 

In here Country is a 'Choice Field' and Mentor is a 'Person Field' in SharePoint. I want to get the Display Name of the 'Mentor' and Value of the Country.

 

In my Gallery control I can use 'Mentor.DisplayName' and 'Country.Value' but in ShowColumns function it doesn't allow to use the same way.

 

Please help.

 

 

Categories:
I have the same question (0)
  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    The ShowColumns function includes columns of a table and drops all other columns. You can use ShowColumns to create a single-column table from a multi-column table. ShowColumns includes columns, and DropColumns excludes columns.

    Essentially this will provide you a collection with a table of "ID", "Name", "Country", "Mentor". What do you want to do with that collection? You can then use LookUp function to get values from this collection.

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • Sanj_ Profile Picture
    30 on at

    Hello @phipps0218 

     

    Thank you for your prompt response. 

     

    'Mentor' is a person field and 'Country' is a choice field in SharePoint. If I used the below method, it doesn't give me the the values for 'Mentor' and 'Country'.

     

    ClearCollect(collectionA, ShowColumns(Student, "ID", "Name", "Country", "Mentor"))

     

    Simply I want to get the DisplayName of 'Mentor' and Value of 'Country' when creating collection.

     

    Like:

    ClearCollect(collectionA, ShowColumns(Student, "ID", "Name", "Country".Value, "Mentor".DisplayName))

     

     

     

  • Verified answer
    WarrenBelz Profile Picture
    155,042 Most Valuable Professional on at

    Hi @Sanj_ ,

    You can call the added columns anything except the original names

    ClearCollect(
     collectionA, 
     ShowColumns(
     AddColumns(
     Student,
     "Nationality",
     Country.Value,
     "Teacher",
     Mentor.DisplayName
     ),		 
     "ID", 
     "Name", 
     "Nationality", 
     "Teacher" 
     )
    )

     

    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.

    Visit my blog Practical Power Apps

  • Sanj_ Profile Picture
    30 on at

    Hi @WarrenBelz 

     

    It worked for me. Thanks a lot. 🙂 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 476

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 339

Last 30 days Overall leaderboard