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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

ShowColumns - hidd

(0) ShareShare
ReportReport
Posted on by 10

Hi,

I'm building a a project dashboard overview, where all information is stored in a list. I'd like to be able to display a subset of the columns in this list in a Powerapps Table or Display Form (or any other solution that would allow me to to display a subset of the underlying list in one view).

This is a snapshot of the list:

DummyList.png

I can display the full List in a table by linking this list (DummyList) as data source, or by setting Item = DummyList

Full.png

At the moment, I'm using a table to display a subset of the list columns using the ShowColumns function, as explained here. Note that using the ShowColumns function results in displaying only the desired columns.

However, when I use this function [Items = ShowColumns(DummyList,"Title", "Column2")] on a table, I still see all the headers of the list displayed (even if I did not mention these columns in the ShowColumns function). My guess is that I am doing something wrong, but I do not know what.

Table.png

As an alternative, I tried calling this function on a Display Form, but this throws an error. I could select the columns to be displayed manually  via "Edit Fields," but I want the information to appear automatically or via a programmatic way.

Display.png

 

Last thing I tried, was creating a collection via a button with [OnSelect = ClearCollect(MyCollection, ShowColumns(DummyList, "Title","Column2"))]. However, when I use this collection as datasource for a Table or Display Form, it seems I have to select the columns to display manually via "Edit Fields".

Collection.png

I'm quite new to Powerapp, but have been looking for an answer to this topic for some time now and can't solve it myself - any help on this would be highly appreciated!

 

Categories:
I have the same question (0)
  • Verified answer
    MarvinBangert Profile Picture
    1,924 Most Valuable Professional on at

    Hey @Sasker 

    you can use a context variable to change the visible function within your columns:

    I created a button with OnSelect:

    UpdateContext({varVisible: !varVisible})

    Select the column within your DataTable and change the "visible" state to "varVisible":

    Image 608.png

    Image 609.png

    If you click on the button, the columns will be shown or hidden.

    Image 610.pngImage 611.png

     

    Hope this will help you.

     

    Regards

    Marvin

  • v-yutliu-msft Profile Picture
    on at

    Hi @Sasker ,

    Do you want to only display "Title", "Column2" of your list in the data table?
    The reason why you met this problem is that you didn't choose the columns that you want to display when you use ShowColumns function.

    Every time you set items of data table, you need to choose the columns that you want to display.

    The columns displaying in the data table will not be updated automatically.

    Here's my solutions:

    1)delete your original data table, insert a new data table.

    set the new data type's Items:

    ShowColumns(DummyList,"Title", "Column2")

    Then the new data table will only display the Title and Column2 field. It will not retains the old one's data.

     

    2)If you still want to use original data table, after you change the data table's Items, you need to reselect fields to display.

    For example: 

    First time, set the data table's Items:DummyList

    Then, change the data table's Items: ShowColumns(DummyList,"Title", "Column2")

    Then, reselect the fields to display.

    203303.PNG

     Remove all the fields that you do not need any more, just retain those you want: "Title", "Column2".

     

     

    Best regards,

  • Sasker Profile Picture
    10 on at

    Thanks Marvin! That worked right away!!!

  • Sasker Profile Picture
    10 on at

    Hi Phoebe, 

    Many thanks for your fast feedback!

    You solution explains the functioning of ShowColumns very clearly. However, it requires still a manual step in the app creation phase to select the columns that should be visible, while I actually wanted to give the end user control of which columns are visualized; therefore I selected Marvin's solution in the end.

    Kind regards,
    Sasker

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard