Hi,
I want to hide a button when data is missing from a gallery but struggling to find the answer: I want to hide or disable the Save button if the tick box is ticked but no display name is selected. Not all rows will have the tick box selected so I only want the button hidden/disabled when the tick box is ticked and no employee has been chosen in the display name dropdown. The display name dropdown only displays when the checkbox is ticked:
the formula I have tried on the Visible variable is: If(IsEmpty(Filter(SearchResultGallery.AllItems,"ID"="ID1",!IsBlank(inputRecdDel.Value)&& !IsBlank(RecdEnterName.Selected.DisplayName))),true,false)
This returns no error but does not hide the button.
Can anyone help?
Many thanks
Mike
Solved! Go to Solution.
Hey @Anonymous
You can set the Visible property of the button outside the gallery as:
If(CountRows(Filter(Gallery3.AllItems,Checkbox2.Value && IsBlank(ComboBox1.Selected.Value1))) > 0, false,true)
Here, Gallery3 is the name of gallery control, checkbox2 is the name of checkbox inside the Gallery and Combobox1 is the name of the combobox control.
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!
You want it to hide or disable the save icon if ANYTHING in the gallery has that checkbox selected or if the one you are currently on?
If you have the icon outside the gallery the icon looks at the gallery as a whole so you either have to do a Gallery.AllItems or Gallery.Selected...you can do an if statement to do AllItems but only certain also if you need that.
Also, if the save button is outside the gallery what it is doing...patching the selected item?
Hi @Anonymous ,
Did you mean that you have inserted a people picker dropdown and a submit button control inside the template part of the gallery control? If so, then please set below formula in the Visible property of button control:
If(CheckBox1.Value=true&&!IsBlank(DataCardValue1.Selected),true,false)
Regards,
Mona
Hi Rebeccas,
The Save icon is outwith the gallery and yes i want to disable it if anything in the gallery has the checkbox selected and yes the Save button is patching the items to a SharePoint list, here is formula:
ForAll(RenameColumns(SearchResultGallery.AllItems,"ID","ID1"),Patch(SPList,LookUp(SPList,ID=ID1 && Status="Delivered to Office"),{Status: If(inputRecdDel.Value=true,"Office Received"),RecdBy: RecdEnterName.Selected.DisplayName,Received: inputRecdDel.Value}));Refresh(SPList)
thanks
Mike
Hey @Anonymous
You can set the Visible property of the button outside the gallery as:
If(CountRows(Filter(Gallery3.AllItems,Checkbox2.Value && IsBlank(ComboBox1.Selected.Value1))) > 0, false,true)
Here, Gallery3 is the name of gallery control, checkbox2 is the name of checkbox inside the Gallery and Combobox1 is the name of the combobox control.
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!
Thanks @yashag2255 !
That works! so i have updated the Visible property to: If(CountRows(Filter(SearchResultGallery.AllItems,inputRecdDel.Value && IsBlank(RecdEnterName.Selected.DisplayName))) > 0, false,true)
Your help is much appreciated!
Mike
Thanks for your reply, your solution partially worked: if the checkbox was selected but no display name was selected then the save button was visible. The save button was only hidden when the display name dropdown was selected.
Thanks for your response
Mike
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
47 | |
46 | |
34 | |
33 |
User | Count |
---|---|
258 | |
87 | |
79 | |
68 | |
67 |