cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
G99 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
Dual Super User
Dual Super User

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
Dual Super User
Dual Super User

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
G99 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

G99 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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (7,897)