Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
_amiiine_
Contributor III
Contributor III

How to Validate User Input with a Condition Block?

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!

Labels (3)
5 Replies
Bhushan_Mahajan
Creator II
Creator II

@_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.

JandreKillianRIC
Partner Ambassador
Partner Ambassador

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

diegozecchini
Specialist
Specialist

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}$')

_amiiine_
Contributor III
Contributor III
Author

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

diegozecchini
Specialist
Specialist

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).