Hi,
ClearCollect(col_Controls_Apps,
DropColumns(
BPHC_Controls_Apps,
"_ownerid_value", "createdby", "createdonbehalfby", "createdon", "importsequencenumber", "modifiedby", "modifiedonbehalfby", "modifiedon", "owningbusinessunit",
"owningteam", "owninguser", "overriddencreatedon","statecode", "statuscode", "timezoneruleversionnumber", "utcconversiontimezonecode", "versionnumber")
);​
Hi,
Thank you. I can't believe I missed this as I have read this help page before for AddColumns, DropColumns and RenameColumns as I have used all these before.
AddColumns, DropColumns, RenameColumns, and ShowColumns functions in Power Apps - Power Platform | Microsoft Learn
However after trying today I have given up on this idea. When using ShowColumns it forces you to do so by the Schema name rather than the Display name when listing them out. It then appears the resulting Collection no longer can refer to the Display Name and everything else in my App breaks.
Hi @messengineer ,
Sorry try this...
ClearCollect(col_Controls_Apps,ShowColumns(BPHC_Controls_Apps,"<column 1>","<column 2>"))
Example from Accounts:
ClearCollect(AccountCollection,ShowColumns(Accounts,"name","numberofemployees"))
This created a collection with the following:
Hi,
Thanks whilst that is a handy feature I was not aware of being new to Dataverse ... it only sorts/filters the data to the view ... all the unwanted columns still appear in the Collection.
ClearCollect(col_Controls_Apps,AddColumns(Filter(BPHC_Controls_Apps,'BPHC_Controls_Apps (Views)'.col_Controls_App), "txtSelect",""));
It won't allow me to build a Collection directly from the View
ClearCollect(col_Controls_Apps,AddColumns('BPHC_Controls_Apps (Views)'.col_Controls_App, "txtSelect",""));
Or am I still missing something?
Hi @messengineer ,
Utilize Dataverse views to accomplish this filter for you in the collection. Example:
ClearCollect(AccountCollection,Filter(Accounts,'Accounts (Views)'.'Active Accounts'))
The above will populate the AccountCollection with only the fields in my Active Accounts view.
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional