Hi
I am using PowerApp Form with 19 Text Fields where users provide input and submit the Form to SharePoint list. Then a page gets created(using Flow) in the SitePages library of SharePoint site with all the dynamic text values provided by users . Everything is working fine until I realised that when users are using "(double quote) or \(backslash) special characters, the Flow is getting failed with Bad Gateway error.
Is there anyway I can do in PowerApps text fields where users are not allowed to enter "(double quote) and \(backslash) ??
".*[\\\"&Char(34)&"].*"is called a regular expression. Regular expressions define a pattern to be found in a text string. ISMATCH returns true when the pattern is found in a text string and false when the pattern is not found. This particular regular expression says
If you want to learn how to do this you can take a free 1 hour course at this website. Its really fun and its how I learned.
Don't forget to mark my original post as the solution please 😄
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Thank you very much for the solution. It worked. But instead of inserting labels for error messages, I have added code and made changes as per my requirement to the default error message labels created by PowerApps itself for every data cards.
Can you please also help me in understanding in bits & pieces the expression (".*[\\\"&Char(34)&"].*") ???
You can also simply just use the Replace and Substitute functions in PowerApps before submitting.
------------------------------------------------------------------------------OfficePowerUser.com------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up.
You can detect if a user input a blackslash ( \ ) or and double quote ( " ) using this code
IsMatch(TextInput1.Text,".*[\\\"&Char(34)&"].*")
Input of these characters into the text field cannot be prevented but you can alert the user when an error is made. Create an label for each input field to display an error message when the illegal character is input. Name the labels: emsg1, emsg2, emsg3... emsg19
Text: "The symbols \ or "&Char(34)&" are not allowed."
Color: Red
Visible: IsMatch(TextInput1.Text,".*[\\\"&Char(34)&"].*")
Finally, you should prevent the user form submitting the form when any error messages are displaying. Put this code in the DisplayMode property of your submit button
If(
And(
!emsg1.Visible,
!emsg2.Visble,
!emsg3.Visible
...
!emsg19.Visible
),
Edit,
Disabled
)
Note: where you see the three dots ... in my examples you should write out all the labels for 1-19.
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."