Hi All,
I am building an application which is having a form with only four fields. One Field is Event which is a dropdown and having two options only respectively 'Birthday' and 'Anniversary'.
To capture Birthday there is a separate 'Single Line of Text' column and for Anniversary there is a 'Date' Column.
What i want is if The DD selected value is 'Birthday' then the it should validate the data card with MM/DD Format and if 'Anniversary' is selected then it should allow to select the date in the respective field.
I am trying to use below examples of regular expression but somehow it is not working as expected. Can anyone please help how to achieve this?
Option 1
If(
IsMatch(
DataCardValue4.Text,
"[0-9]{2}/[0-9]{2}"
),
SubmitForm(NewItem),
Notify(
"Birth Date Must Be Entered in MM/DD Format.",
TraceSeverity.Information
)
)
Option 2
If(
DDEvent.Selected.Value = "Anniversary" And IsBlank(DataCardValue5), Notify("Enter Date in the Seniority Field"),
DDEvent.Selected.Value - "Birthday" And !IsMatch(DataCardValue4.Text, "[0-9]{2}\/[0-9]{2}"), Notify("Birth Date Must Be Entered in MM/DD
Format."),
SubmitForm(NewItem))
Thanks,
Akshay
Solved! Go to Solution.
Option 2 looks good except that DDEvent.Selected.Value - "Birthday" should be DDEvent.Selected.Value = "Birthday"
Option 2 looks good except that DDEvent.Selected.Value - "Birthday" should be DDEvent.Selected.Value = "Birthday"
Many Thanks @Jeff_Thorpe for highlighting my mistake. 🙂
It worked as expected after correcting as suggested by you. Hence accepting the solution.
Warm Regards,
Akshay
User | Count |
---|---|
124 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
214 | |
181 | |
140 | |
96 | |
83 |