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:
I can display the full List in a table by linking this list (DummyList) as data source, or by setting Item = DummyList
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.
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.
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".
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!
Solved! Go to Solution.
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":
If you click on the button, the columns will be shown or hidden.
Hope this will help you.
Regards
Marvin
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":
If you click on the button, the columns will be shown or hidden.
Hope this will help you.
Regards
Marvin
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.
Remove all the fields that you do not need any more, just retain those you want: "Title", "Column2".
Best regards,
Thanks Marvin! That worked right away!!!
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
User | Count |
---|---|
119 | |
86 | |
83 | |
74 | |
69 |
User | Count |
---|---|
215 | |
179 | |
140 | |
109 | |
83 |