24
Views
3
Comments
Date Format Validation from Excel file
Question
Application Type
Reactive
Service Studio Version
11.54.6 (Build 62311)

Hi

I need to validate the Date format from Excel file. User will be uploading a excel file through OutSystems UI, in that excel file, I have to validate a column which is Date data type. The format should be YYYY-MM-DD format.


Champion

Hi,

For achieving this you just need to check the date column after import is done. Can do in same server action or different one. But if your requirement is only to check the date format not validation then you can also check or change date format before inserting the data in database. Otherwise you can simply loop through all the rows and check format.

regards

Hi Vikas, I need to check the format. For example user is uploading the file with 09-12-2021 date format instead of 2021-12-09. How can I validate it in the code ? Thanks

Champion

Hi,

So when we import any file or upload any file (excel in your case). It will trigger UploadOnChange() method. In this you will get the binary of uploaded excel and here you can go loop through the uploaded excel's rows and can implement the logic of date format check or can change dateformat. 

regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.