cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Validation on clicking button || Lenght of text input

Good afternoon everyone,

I have an issue about my "Crear" button: I want it to be able to click if the "ID FISCAL" text input is with only 11 characters, no more or less.

Thank you,

Jose

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Validation on clicking button

Simply add this to the DisplayMode property of your button:

If(Len("ID Fiscal".Text) =11, DisplayMode.Edit)

You can combine this with the rest of the logic for the DisplayMode of that button if you like.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Highlighted
Super User II
Super User II

Re: Validation on clicking button

@JoseC12 

Add this to your formula

 

|| !(Len(Input_IDFiscal.Text)=11) ...

 

EDIT: @PowerAddict  typing at the same time 🙂

View solution in original post

4 REPLIES 4
Highlighted
Super User II
Super User II

Re: Validation on clicking button

Simply add this to the DisplayMode property of your button:

If(Len("ID Fiscal".Text) =11, DisplayMode.Edit)

You can combine this with the rest of the logic for the DisplayMode of that button if you like.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Highlighted
Super User II
Super User II

Re: Validation on clicking button

@JoseC12 

Add this to your formula

 

|| !(Len(Input_IDFiscal.Text)=11) ...

 

EDIT: @PowerAddict  typing at the same time 🙂

View solution in original post

Highlighted
Helper V
Helper V

Re: Validation on clicking button

Thank you to solve me that problem.

Can I also validate to not click the submit button if the "ID FISCAL" text input does not start with "20" for example?

Highlighted
Super User II
Super User II

Re: Validation on clicking button

@JoseC12 

You can utilise the StartsWith() function to help here, like this

 

!(StartsWith(Input_IDFiscal.Text, "20")), Disabled, Edit

 

see here https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-startswith

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published 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 (6,003)