Question
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
Rulesware LLC
SV
Last activity: 22 Mar 2019 9:28 EDT
Specific Hour:Minutes:AM/PM required value request
Good day,
I have a request to capture an specific time with format HH:mm AM/PM. I'm using Date time control with display mode "Dropdowns lists", however when I select in UI just the AM or PM, it allows me to pass without setting the hour or the minutes, I need to have the 3 values. Please advice, I'm using Pega Infinity 8.
see atached image.
***Edited by Moderator Marissa to update platform capability tags****
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
You can also use the regular expression in your java code to match the string format something like \d+\:\d+ [a-zA-Z]{2} this might work for your scenario to match 12:14 AM or 1:12 AM or 1:2 AM,..
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
Hello Hector,
After looking into your screenshot noticed 3 drop down list boxes for the field which means that you might have provided 3 properties to store its dropdown selected value. If that's the case then you need to add the validation on those 3 fields as mandatory, if not can you please share the design time configuration screenshots for these 3 drop down fields along with your validations.
Regards,
Mahesh M
-
SaiKishore Yagnamurthy
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
Rulesware LLC
SV
Hi Mahesh,
Thank you, actually is the form of presentation of the control, I'm ataching the options that I just set in the presentation.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
Rulesware LLC
SV
Any Advice?
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Pegasystems Inc.
IN
Hi,
I checked the behaviour and it is same as you stated.
To avoid the form submit, make it required as always , then you have to select all the dropdown for submiting the form.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
Rulesware LLC
SV
Good day Sahuv1,
I tried your suggestion, but didn't work, wont require third dropdown (the one with AM/PM).
Let me know if you have a diferent approach.
Thank you.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
Hi Hector,
I don't find any OOTB way you can try to make it required because if you choose the value of all the 3 fields then it will be stored as "2:02 AM" format in the clipboard. Let say if you choose either Hours/Minutes/(AM/PM) the property value will not be empty, so i would suggest you to write a simple edit validate rule to cross check whether the property holds this format value (HH:MM AM/PM). This way you can make sure the user choose all the field values with a simple java code.
Hope this might help you.
Regards,
Mahesh M
Accepted Solution
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689979000/321c2db9-adc7-4c43-8f1d-d6a84c486e5a.jpg?itok=mEyE0RUn)
Pegasystems Inc.
US
You can also use the regular expression in your java code to match the string format something like \d+\:\d+ [a-zA-Z]{2} this might work for your scenario to match 12:14 AM or 1:12 AM or 1:2 AM,..
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
Rulesware LLC
SV
Good day Mahesh,
Thank you, I will go with your suggested approach, I'll let you know the outcome.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-08/1c67b0bc-f010-49d6-a689-cf1b4c1ea831.jpeg?h=e03d6d1b&itok=6F95BQIm)
Rulesware LLC
SV
In the end, I used 3 dropdowns with local values and capture all with a Data Transform.
Thank you all for the advice and help.