cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bbsin
Post Prodigy
Post Prodigy

disable next screen if field not complete ? how

Hi 

 

I have 4 screen that needs to be fill up .

Currently if one screen - field is not complete the next button just grey out but user still can go to the next screen

1) how to not allow them to go to the next screen with error message?

 

If(Form1.Valid,DisplayMode.Edit, DisplayMode.Disabled)

 

 

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
HenryARPhillips
Continued Contributor
Continued Contributor

Hi,

IsBlank and the Opposite which is !IsBlank (Is Not Blank). You just wrap around the control you want to basically check if it has a value. Sometimes you must be careful, depending on data type. As sometimes a more suitable options is IsEmpty but I digress.

So say I have a text control called txtInput1. And I have a button called Submit1. I might say that whilst ever txtinput1.Text is blank, disable Submit1.

If(IsBlank(txtinput1.Text),DisplayMode.Disabled,DisplayMode.Edit)

A gotcha with the above, could be that an empty string is present, which technically would not be a blank().

So you might have to play around, with things such as:



IsBlank(txtinput1.Text) Or txtinput1.text = "",DisplayMode.Disabled,DisplayMode.Edit)

For an IsMatch, you are basically validating that the value in a control matches what you specify. So, this could be RegEx or it can be one of the pre-existing data validation types such as Email.

An example:

 

 

HenryARPhillips_0-1613499968129.png

 

 

If the app was also built from a SharePoint List, than you can probably control some of the behaviour such as required and the like via the SharePoint List settings also.

View solution in original post

3 REPLIES 3
HenryARPhillips
Continued Contributor
Continued Contributor

Hi,

To me you are looking to do the right thing. So just to confirm the user would have to click a button that navigates to the screen that you don't want them to be able to go to, unless all fields are filled out suitably?

In that case DisplayMode.Disabled on the button, would prevent an onclick executing.

So I am a bit stumped as to how they can get to the next screen if the button that would facilitate this is disabled? Unless there is another means.

But what might be worth a check is looking closer to the Form1.Valid. So is that actually showing as not valid when you believe it to not be valid. You could for example try and explicitly try it out against the offending field. So things like IsBlank or IsMatch if you wanted to Match it against say a valid email format.

I suppose the above is a long winded way of saying you need to ensure whether Form1.Valid is showing as true or false as if true, it will not be disabled.

 

So you need to keep working to get that to reflect when the Form is valid or not valid. You should be able to select it in the formula and it will show whether it is returning true or false as you work through it.

bbsin
Post Prodigy
Post Prodigy

hi

 

Thanks for replying..   not too sure how to use the Isblank or IsMatch

 

i checked the displaymode is stated as If(form1.vadli, DisplayMode.Edit, DisplayMode.Disabled) and yes still can go to next page even uncompleted.

HenryARPhillips
Continued Contributor
Continued Contributor

Hi,

IsBlank and the Opposite which is !IsBlank (Is Not Blank). You just wrap around the control you want to basically check if it has a value. Sometimes you must be careful, depending on data type. As sometimes a more suitable options is IsEmpty but I digress.

So say I have a text control called txtInput1. And I have a button called Submit1. I might say that whilst ever txtinput1.Text is blank, disable Submit1.

If(IsBlank(txtinput1.Text),DisplayMode.Disabled,DisplayMode.Edit)

A gotcha with the above, could be that an empty string is present, which technically would not be a blank().

So you might have to play around, with things such as:



IsBlank(txtinput1.Text) Or txtinput1.text = "",DisplayMode.Disabled,DisplayMode.Edit)

For an IsMatch, you are basically validating that the value in a control matches what you specify. So, this could be RegEx or it can be one of the pre-existing data validation types such as Email.

An example:

 

 

HenryARPhillips_0-1613499968129.png

 

 

If the app was also built from a SharePoint List, than you can probably control some of the behaviour such as required and the like via the SharePoint List settings also.

View solution in original post

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (36,196)