cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
goldentrophy25
Frequent Visitor

Freezer Log - Passing Along Arguments to Filter Down to Rack

NTt1YIC

 

 I've made all of the screens and buttons I am interested in that will help me filter down to the appropriate rack in a freezer but I need help implementing formulas to do so.  If someone has an example app that already does something similar to this, I think I could make excellent use of it as a template to implement my own code accordingly

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

Hi @goldentrophy25 ,

 

I assumed you would have different data sources for Freezers, Columns and Rows as a result of db normalization to prevent duplication, but I see you have a single list with all information.

 

In that case you may want to use the Distinct function to retrieve the unique values only, for instance for the FreezerGallery:

 

AddColumns(
	Distinct(FreezerLog,FreezerName),
	"FreezerName", Result,
	"Type of Device", LookUp(FreezerLog, FreezerName=Result, 'Type of Device'),
	"Location", LookUp(FreezerLog, FreezerName=Result, 'Location'),
	"Manufacturer", LookUp(FreezerLog, FreezerName=Result, 'Manufacturer'),	
	"Model#", LookUp(FreezerLog, FreezerName=Result, 'Model#')
)

 

The reason that the above is a bit more complicated is because the Distinct function only returns a single column (Result), so you need to add the additional, freezer related data back. This is another argument to having different data sources, because this will take care of that complexity.

 

 

 

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

5 REPLIES 5
BCBuizer
Super User
Super User

Hi @goldentrophy25 ,

 

Starting off with the first screen: The OnSelect property of the "View/Edit Box" button should be set to Navigate(FreezerSelectionScreen) (or whatever name the second screen has) to take the user to the screen to select the freezer.

 

In the second screen I recommend to use a Gallery instead of buttons to select the gallery as this will make you app more dynamic. This comes in handy when you would ever need to add/remove/edit freezers. The code for this really depends on what your data looks like, so if you can share a bit more about that, that would help: what data source are you using? How is the data stored?

 

Pretty much the same as for the second screen goes for the third and fourth screen as well.

 

At the fifth screen you seem to already be using a gallery, but the data will need to be filtered, so info on your data is needed for that also. Probaby it will look something like: 

Filter(DataSource, Freezer = FreezerGallery.Selected, Column = ColumnGallery.Selected, Row = RowGallery.Selected)

 

Finally a sixth screen needs to be added to include a form where the user can view/edit the detail of the selected element.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Thanks I will make sure to use galleries.  My bigger question is how am I passing along the filter using the gallery as I do this?  I assume it's an OnSelect formula that saves the choice as it goes through the screens

BCBuizer
Super User
Super User

Hi @goldentrophy25 ,

 

You don't need to pass anything down since you can reference back. In the code for a possible filter you can see I referenced back to the three galleries from the previous screens: FreezerGallery, ColumnGallery and RowGallery. Of course these are names I picked and you can change them to anything you want.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Sorry about giving such a short reply previously.  I am using a SharePoint list as my connection and data source.  When I tried to add a gallery to filter down my data at the freezer selection level, it's just doing every item on my list.  My list is displayed below, along with the gallery I used.  My goal at that screen is just to have buttons for freezer options - not every line item

goldentrophy25_0-1668451650266.png

goldentrophy25_1-1668451672833.png

 

 




BCBuizer
Super User
Super User

Hi @goldentrophy25 ,

 

I assumed you would have different data sources for Freezers, Columns and Rows as a result of db normalization to prevent duplication, but I see you have a single list with all information.

 

In that case you may want to use the Distinct function to retrieve the unique values only, for instance for the FreezerGallery:

 

AddColumns(
	Distinct(FreezerLog,FreezerName),
	"FreezerName", Result,
	"Type of Device", LookUp(FreezerLog, FreezerName=Result, 'Type of Device'),
	"Location", LookUp(FreezerLog, FreezerName=Result, 'Location'),
	"Manufacturer", LookUp(FreezerLog, FreezerName=Result, 'Manufacturer'),	
	"Model#", LookUp(FreezerLog, FreezerName=Result, 'Model#')
)

 

The reason that the above is a bit more complicated is because the Distinct function only returns a single column (Result), so you need to add the additional, freezer related data back. This is another argument to having different data sources, because this will take care of that complexity.

 

 

 

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,881)