Get Date in Input Dialog And Control of Date

Hi all,

  • i want to get Date from input dialog. (I’m saying user should write like that : dd.MM.yyyy)
    User : 10.09.2020 but how can i check it is true or not and want to check every single integer or date?
  • I want to show to log message by-one-by day another log message month etc. How can i do that?

Thanks.

@yigit.aybey You can validate that using below exp. Attached workflow ref

Variable of type boolean Format= DateTime.TryParseExact(Input, "dd.MM.yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, Nothing)

Format variable returns True if the entered data format is dd.MM.yyyy else false
Input is the variable that contains the date entered by the user

Example.zip (3.9 KB)

Please install Workflow Manager Activities once you open it

Capture1

Output

Capture

1 Like

@yigit.aybey

  1. You can mention the required date format to be entered by the user in Label field of Input Dialog activity.

  2. Assign the Input Dialog activity output to one string variable named strDate.

  3. And then check below conditions to validate whether entered date is correct or not.

       CInt(strDate.Trim.Split("."c)(0)) > 0 AND CInt(strDate.Trim.Split("."c)(0)) <= 31 
    
      CInt(strDate.Trim.Split("."c)(1)) > 0 AND CInt(strDate.Trim.Split("."c)(1)) <=12
1 Like


Sequence.xaml (7.0 KB)

  1. Input Dialogue box
  2. Check date in correct format
  3. Printing day and month
1 Like

Thanks for your help guys (@Lak_Ui, @lakshman and @ushu), i appreciate your effort and guidance.

2 Likes

Please mark as solution for whichever reply helped. so that it will be useful for others as well

Actually, i’m using your answer and also @lakshman answer to. When user enter smt big number like month or day i’m showing the message to user and keeping the number in log message. On the other hand, when user enter “/” or different number or smt i’m using your program as well.
:slight_smile:

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.