cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gingerelm
Level: Powered On

disable button until all textinputs in a gallery is filled in.

Hi, 

 

how do i disable button until all textinputs in a gallery is filled in. 

 

i placed textinput boxes into a gallery and only when all boxes are being filled up will i want the user to submit and then the data will be patched accordingly.

 

i currently tried If(textinput.text= "", displaymode.disabled, displaymode.edit) for my submit button but it becomes edit after the first textbox is filled in when the rest have not been filled in.

1 ACCEPTED SOLUTION

Accepted Solutions
mr-dang
Level 10

Re: disable button until all textinputs in a gallery is filled in.

Hi @gingerelm,

You can look at all text input boxes in a gallery by drilling into the Gallery's 'AllItems':

 

IsEmpty(Filter(Gallery1.AllItems,IsBlank(TextInput1.Text)))

The statement above means, "Filter all the items in the gallery where the text input box is blank. If there are none--it's empty--then return true, if not, return false." Reverse this with Not() if you want to think of it in the opposite meaning.

 

You can place this condition in the Visible property of your submit button so that it is shown/hidden. Or you can place it in the DisplayMode property to disable it until it meets that criteria.

 

Let me know if this works out with a thumbs up.

 

Mr. Dang

________

Microsoft Employee
@8bitclassroom

View solution in original post

2 REPLIES 2
mr-dang
Level 10

Re: disable button until all textinputs in a gallery is filled in.

Hi @gingerelm,

You can look at all text input boxes in a gallery by drilling into the Gallery's 'AllItems':

 

IsEmpty(Filter(Gallery1.AllItems,IsBlank(TextInput1.Text)))

The statement above means, "Filter all the items in the gallery where the text input box is blank. If there are none--it's empty--then return true, if not, return false." Reverse this with Not() if you want to think of it in the opposite meaning.

 

You can place this condition in the Visible property of your submit button so that it is shown/hidden. Or you can place it in the DisplayMode property to disable it until it meets that criteria.

 

Let me know if this works out with a thumbs up.

 

Mr. Dang

________

Microsoft Employee
@8bitclassroom

View solution in original post

Highlighted
KOM_4410
Level 8

Re: disable button until all textinputs in a gallery is filled in.

Hi @gingerelm

 

What I do on that case is to check all the text fields. let's say you have texbox1, textbox2 and textbox3 that need to have data before allowing to submit. Then I use:

 

If(IsBlank(textbox1) Or IsBlank(textbox2) Or IsBlank(textbox3),action1, action2)

 

Note that if you have a different type of field it may be different. For example, if you have a Dropbox with a default value ="", then is Dropbox.Selected.Value="" instead of IsBlank().

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,067)