cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Partisan
Post Partisan

fx for displaying a button if user has data in gallery

HI

I have a a few screens, one of my screens is for another user, user2 to complete a section.

On this screen I would like to place a button 'my forms' and would like it to be disabled if the user does not have any submitted forms in the gallery.

I have tried a few fx but cannot get it right to work, is someone aware what the function to use on the DisplayMode property?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: fx for displaying a button if user has data in gallery

Hi @G99 

 

Can you try to set the DisplayMode of the button as:

If(CountRows(Gallery1.AllItems) = 0, DisplayMode.Disabled, DisplayMode.Edit)

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

3 REPLIES 3
Highlighted
Dual Super User III
Dual Super User III

Re: fx for displaying a button if user has data in gallery

Hi @G99 

 

Can you try to set the DisplayMode of the button as:

If(CountRows(Gallery1.AllItems) = 0, DisplayMode.Disabled, DisplayMode.Edit)

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted
Post Partisan
Post Partisan

Re: fx for displaying a button if user has data in gallery

HI @yashag2255 

 

Thanks, I tried something similar to that and it didn't work prior to posting my question, and I've tried your suggested function and it's the same behaviour the button is not disabled for a user who has no created items created by them and I believe the fx requires some logic?

i.e. currently I'm filtering Gallery1 with the following fx:

 

'Created By'.Email=VarUser

 

Thanks

Highlighted
Post Partisan
Post Partisan

Re: fx for displaying a button if user has data in gallery

apologies, it works, looks like it took a little while longer for the published version to kick in

Thanks

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

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

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,173)