cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Store Filtered Records/Table to a Variable

Hi everyone,

So I have a this table that I use as a data source in my power app.

 

Capture.JPG

 

And I want to filter this table based on the BaggageId. The BaggageId will be selected from a DropDown. So I performed following formula 

 

Filter('[dbo].[vBaggageHistory]',BaggageId=Dropdown_baggagetracking.Selected.Result && Status=1)

 

Since this table will be used in multiple points on one screen, I was thinking to store this filter result in a varible, so my app doesnt have to perform filtering every single time. And so I executed this formula

 

UpdateContext{ varFilteredResult : Filter('[dbo].[vBaggageHistory]',BaggageId=Dropdown_baggagetracking.Selected.Result && Status=1)}

 

However, in this variable only the value from BaggageId and Status are stored. For other attributes (Id, Message, UTCTimeStamp) the values are not stored (blank). It looks like only the values from the attributes used in filter function conditional expression are stored. Does anyone know how I can store all values from filtered table/record?

 

Capture1.JPG

 

 Many Thanks in advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resident Rockstar
Resident Rockstar

Re: Store Filtered Records/Table to a Variable

Do you have explicit column selection turned on in the app's settings?

View solution in original post

4 REPLIES 4
Highlighted
Resident Rockstar
Resident Rockstar

Re: Store Filtered Records/Table to a Variable

Do you have explicit column selection turned on in the app's settings?

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Store Filtered Records/Table to a Variable

On visible of the screen:
Set(Varbaggagetracking,Dropdown_baggagetracking.Selected.Result)
Then filter:
Filter('[dbo].[vBaggageHistory]',BaggageId=Varbaggagetracking&& Status=1)

Highlighted
Regular Visitor

Re: Store Filtered Records/Table to a Variable

Indeed this does the trick. Now all attributes values are stored. When I turned this setting off, what kind of effects does it bring for my app?

Highlighted
Resident Rockstar
Resident Rockstar

Re: Store Filtered Records/Table to a Variable

Explicit column selection speeds up data processing by only including columns that are used in the app. So if a column in your data source is not referenced anywhere, it will ignore it. By turning this option off, all of your data sources will pull down all column values in your app.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,370)