I have a datatable to store data I’m pulling from a windows app list. I’ve aaded an additional column (Deleted) that I want to always populate with the current date/time.
The column is ‘Deleted’ Data Type=String, Default Value = Now.ToString(“MM/dd/yyyy hh:mm tt”).
WHen I write the datatable to Excel, I get every column except a value in ‘Deleted’. When am I doing wrong?
It could be due to Deleted is a reserved keyword by underneath programing language. Try naming your column little bit different than Deleted like DeletionDate
Also make sure you are able to see the column value before writing to excel.
Hi @Mike_Wyller1
Welcome to UiPath,
The issue is that the DefaultValue is applied only when a new DataRow is created without explicitly setting that column, and in many UiPath table-building cases it won’t populate as expected for existing rows. Keep the Deleted column as DateTime if possible, or explicitly set it when adding each row,
e.g. row(“Deleted”) = Now.ToString(“MM/dd/yyyy hh:mm tt”).
Happy Automation