Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good evening, everyone!
I'm using Qlik App Automation, and I want to add a condition to check whether the user's input follows the format YYYY-MM-DD HH:MM.
For this, I'm using the regex ^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$.
How should I configure the condition block to properly validate this format?
Any help would be greatly appreciated!
@_amiiine_ Try below expression.
If(Match(Text(YourDateField), '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$'),
then execute your script
else end.
Hi @_amiiine_
Where are the users entering this input? Is this a variable in the front end of Qlik?
If this is a variable, I would just use a normal text object to test this and save the automation.
Regards Jandre
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
Hi
try to set the condition type to "Expression Evaluation" and use the expression: Match(Text(YourInputField), '^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$')
Hi Jandre,
The users enter the data in an Input Block within the automation.
Let me know if you need more details!
Best regards,
Amine
Hi!
To validate user input in Qlik App Automation using a Condition Block, you can add a Condition Block in your automation and set condition type to "Expression Evaluation" in the condition settings.
Use the following expression to match the required format:
Match(Text(YourInputField), '^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$')
YourInputField should be replaced with the actual field where users enter data.
finally in output paths
If the condition matches, proceed with the next step in the automation.
If it doesn’t match, handle errors (e.g., sending an alert or stopping execution).