I have a form in Canvas App which is connected to a SharePoint list. It has a numeric field. So when submitting the form I'm checking if that field (CreditCardNumber) has sixteen digits entered.
OnSelect Submit Button - If(Len(CreditCardNumber.Text) <> 16,Notify("Please Enter 16 Digit Credit Card Number",NotificationType.Error),SubmitForm(Form1);NewForm(Form1));
So now the issue I m facing is even though I have entered(16 digits) value in the field the "CreditCardNumber.Text" is returning blank. It was working fine a day before but now its returning blank and I m getting the notification message "Please Enter 16 Digit Credit Card Number" as a result.
When I tried to see if the same thing works in OnChange property of the field, there its ("CreditCardNumber.Text") showing the value.
I am not able to figure out why its returning blank in OnSelect or anywhere else other than OnChange of the field.
Can anyone point me in the right direction?
Thanks for the help in advance!
To be honest I am not exactly sure why text input fields even have an OnSelect property. That property is so you can tell it what happens when someone clicks on the text field.
OnChange is where the 'magic' happens. When the value changes, do something.
Try this instead in your Submit button. This will eliminate the need to have a collection of the result of the split, as split creates a table that you can use.
If( (Count(Len(Split(CreditCardNumber.Text, "")).Result) <> 16,Notify("Please Enter 16 Digit Credit Card Number",NotificationType.Error),SubmitForm(Form1);NewForm(Form1));
I require the table created by spilt there is a big functionality depending on that table from split. For a normal text field this OnChange is working fine but for a field embedded in EDIT FORM from a SharePoint list its not working as expected. Wanted to see if this is a bug.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.