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.
Solved! Go to Solution.
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
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
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))
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
200 | |
100 | |
61 | |
59 | |
58 |
User | Count |
---|---|
254 | |
164 | |
90 | |
79 | |
70 |