Hi everyone! I want to that my input field get only 8 symbol. How can i do this?
There is no direct way to limit input length, so what I would suggest instead is to use input validation techniques to either alert the user that the input is too long, or not allowing the user to continue (switch page, save, whatever is your case) before the input is less than 8 characters. Here’s some examples of input validation.
You could bind your input to a page variable, then receive the page variable changed event:
Set PAGE_Var = RIGHT_STRIP(pageVars.PAGE_Var, LENGTH(pageVars.PAGE_Var) - 8).
That should keep the input to 8 characters or less.
Thank you! Where I should write this formula?
RIGHT_STRIP(pageVars.PAGE_Var, LENGTH(pageVars.PAGE_Var) - 8).
You put a set Page Variable flow function in the page var changed event. And just set the page variable = that formula
I hope that works. My only concern is that would change the page variable inside of its change event which might cause the event to fire again on itself. Im not sure if that will get handled correctly. Give it a try and see!
Sorry, but there I can’t bind ‘set page variable’ to ‘formula’.
Also I tried to bind it to ‘Assigned value’ and for ‘input value’.
It’s not working…
Any other ideas to solve it?
Could anyone help?
Youre in the wrong area to Receive Event. You need to be in the Page Layout area, not the Input Field Phone Number component.
I set as you wrote, thank you anyway!
Could you suggest other ways, please?
The closest I could get to is to set a Receive event flow function, set it to page variable your_text changed, add an IF flow function to check if
LENGTH(your_text) > 8, and if that evaluates as true then use
TRUNCATE(your_text, 8, "") to set the length back to 8. This results in a small hackiness in the UI when the user goes over 8 characters, but gets the job done