1 Reply Latest reply on Feb 12, 2015 11:19 AM by dmshimself

    Importing a non-formatted/string date field

    Expert

      Hi Folks,

       

      Was going to ask for advice but got interrupted and then managed to solve this on my own.

       

      Was very simple in the end, so in case useful to anyone else...

       

      If you want to import a date field into LDSD, but the source is a string field, you won't be able to map the source to a target date field.

       

      Instead create an intermediate field to import to and use a calculation to re-format on import and update the desired date field.

       

      Do all this before you first run the import or the date field won't auto-update.

      Create a new string attribute called something like "Temp Date String Import", and set the import from your unformatted source date field to this.

      In Object Designer, on your desired target date field, add a "Before Save" calculation:

       

      import System

      static def GetAttributeValue(User):

        Date1 = User._TempDateStringImport

        Value = date.Parse(Date1)

        return Value

       

      Set the dependency to your temp field, e.g. "_TempDateStringImport"

       

      Run the import and the date field should populate.