Hi guys,
someone knows, if there is an option to accept just the latin characters data set in Power apps?
Let's say: " ' " is allowed, instead of " ‘ "
I want to avoid use substitution formula and start to list all the special characters one by one.
thanks for help
Solved! Go to Solution.
There's no way to prevent it directly as the user is entering data, but you can give the user a visual indication that they entered an invalid character, and possibly prevent them from moving forward in the app (such as disabling a "next" button).
The attached app shows one way to implement this. It uses the IsMatch function to color the border of the text input in red if it contains any "invalid" character:
If( IsMatch( TextInput1.Text, "[ a-zA-Z!\""\$%&\'\(\)\*\+\,\.\-\/0-9:;<=>\?@\[\\\]\^_`\{\|\}~\r\n]*", MatchOptions.Complete), RGBA(0, 18, 107, 1), Color.Red)
If you want to know exactly which character is invalid, you can use an expression like the one below. The idea is to Split the text that you want to verify, then Filter the characters for invalid ones - I used the Find function to look for the character in a label that contained all the "valid" characters - then Concat all of them together to display in a label:
"Invalid characters: " & Concat( Filter( Split(TextInput1.Text, ""), IsBlank(Find(Result, lblAsciiCharacters.Text))), Result)
There's no way to prevent it directly as the user is entering data, but you can give the user a visual indication that they entered an invalid character, and possibly prevent them from moving forward in the app (such as disabling a "next" button).
The attached app shows one way to implement this. It uses the IsMatch function to color the border of the text input in red if it contains any "invalid" character:
If( IsMatch( TextInput1.Text, "[ a-zA-Z!\""\$%&\'\(\)\*\+\,\.\-\/0-9:;<=>\?@\[\\\]\^_`\{\|\}~\r\n]*", MatchOptions.Complete), RGBA(0, 18, 107, 1), Color.Red)
If you want to know exactly which character is invalid, you can use an expression like the one below. The idea is to Split the text that you want to verify, then Filter the characters for invalid ones - I used the Find function to look for the character in a label that contained all the "valid" characters - then Concat all of them together to display in a label:
"Invalid characters: " & Concat( Filter( Split(TextInput1.Text, ""), IsBlank(Find(Result, lblAsciiCharacters.Text))), Result)
Thanks Carlos! I will try to do that
I appreciate your help
User | Count |
---|---|
196 | |
124 | |
87 | |
49 | |
42 |
User | Count |
---|---|
284 | |
163 | |
138 | |
75 | |
72 |