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

button that opens screen with filtered gallery

Hi all

 

I am quite new with powerapps and like some advice. I have coded a button on the 'homescreen'. I'd like this button to open another screen 'BrowseScreen1' and on that screen to filter in a gallery (set as 'items - recordscollection') based on the text in the button from the homescreen. the sourcedata is an xl file on onedrive 'thedata'

 

Navigate (BrowseScreen1,Fade)||Filter(thedata,'Business Unit'= 'Buttonpharma&agro'.Text.value)

 

the filter formula works when I put it simply on the gallery item, but I can't get them to work together... I think that in the above formula the gallery name is missing where to filter it in, but I could be wrong... any ideas?

 

oh yes... I also coded a search label for the browseScreen1 (to complicate a bit) to search in this filtered gallery...

the simple Search function works - Search(thedata,SearchBox.Text,"product_name") - but is it possible to do this search only after the filter of the button has works... in the same gallery that is... 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: button that opens screen with filtered gallery

@CedricC_1 

Put this code in the OnSelect property of each button on your main page.  Change BusinessUnit1 to match your Business Unit.

Set(currentBusinessUnit, "BusinessUnit1");
Navigate(BrowseScreen1, Fade);

 

Then use this code in the Items property of the gallery

Filter(thedata,'Business Unit'= currentBusinessUnit)

 

Finally, you can add the SEARCH functionality to the code above like this.

Search(Filter(thedata,'Business Unit'= currentBusinessUnit),SearchBox.Text,"product_name")

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

10 REPLIES 10
Highlighted
Super User
Super User

Re: button that opens screen with filtered gallery

@CedricC_1 

Put this code in the OnSelect property of each button on your main page.  Change BusinessUnit1 to match your Business Unit.

Set(currentBusinessUnit, "BusinessUnit1");
Navigate(BrowseScreen1, Fade);

 

Then use this code in the Items property of the gallery

Filter(thedata,'Business Unit'= currentBusinessUnit)

 

Finally, you can add the SEARCH functionality to the code above like this.

Search(Filter(thedata,'Business Unit'= currentBusinessUnit),SearchBox.Text,"product_name")

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

Frequent Visitor

Re: button that opens screen with filtered gallery

great! thanks for the quick reply, works perfect

Highlighted
Community Champion
Community Champion

Re: button that opens screen with filtered gallery

Can you show a screenshot of the Button. Will the Text on the button be changing?

If it is The Text in a TextBox1 then do the following:
1. Set(MyText,TextBox1) --- OnVisible of the Screen where the Textbox1 is located

2. On the Naivigation button:
   Navigate (BrowseScreen1,Fade)

 On the Item of the Gallery put:
     Filter(thedata,'Business Unit'=MyText )

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

Highlighted
Frequent Visitor

Re: button that opens screen with filtered gallery

I am affraid I was a bit too fast.... I receive no fault messages... but when clicking on the button, it opens the second screen but the gallery stays empty ... which is strange as I can change the layout and it doesn' t seem to be wrong... anything I am looking over?

Highlighted
Super User
Super User

Re: button that opens screen with filtered gallery

@CedricC_1 
First, try this code on its own.  Let me know if it works.

Filter(thedata,'Business Unit'= currentBusinessUnit)

 

Then try it with SEARCH just like I provided in my previous post.  I assume you haven't typed anything into the search box yet, correct?  Please try doing that.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Frequent Visitor

Re: button that opens screen with filtered gallery

Hi again

 

correct, I haven't put in the search box yet. 

 

the thing is that the code on it's own isn't giving an error message, it's simply not showing the list of filtered items… the gallery stays empty. is there another way to see if the code is working? because In all logic it should be working… 

 

my apologies for these rookie questions

Highlighted
Super User
Super User

Re: button that opens screen with filtered gallery

@CedricC_1 

Please try my suggestions above and then let me know what the result was.

Highlighted
Frequent Visitor

Re: button that opens screen with filtered gallery

hey

Filter(thedata,'Business Unit'= currentBusinessUnit)

unfortunately doesn't work on it's own either...should though... reading through tutorials for hours, but can't find out the reason the gallery is not returning the fields...

Highlighted
Super User
Super User

Re: button that opens screen with filtered gallery

@CedricC_1 

What type of column is Business Unit in SharePoint?  Are you getting any errors or warnings?

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 (7,104)