Start a new topic

Dictionary Formula

Hello,

 

I need a dictionary formula for one of my imports. I have a column that is either blank or will have some data in it. If it has any sort of data in a cell, I need to add today's date. If it is blank, I need it to stay blank.

 

Is this possible? Any help would be appreciated!

 

Thanks

 

Steve


Hi Steve,

You could do a regular expression dictionary where value to match on is ^.+$ and replacement value is the date. However this would require changing the date to today's date every time you ran the import.

If you aren't hosted this could be accomplished very easily through the API. Create a virtual field for the date and map it appropriately (for example record type = gift field, value type = date). For this example we'll say that the field that you're checking for blank is C and the virtual field is G

Open the API and in the section just below where it says Public Overrides Sub BeforeDictionaries(Cancel as ImportOM.API.iCancel) you would put the following:

Dim todaysdate As Date
todaysdate = today

If Import.Fields.GetByExcelName("C").Value = "" Then
Import.Fields.GetByExcelName("G").Value = ""
Else
Import.Fields.GetByExcelName("G").Value = todaysdate
End If

Thanks,

John

Hi John,

 

Sorry for the delay in replying but that regular expression worked perfectly so many thanks for that. What I have been thinking, which would be even better would be if there was an expression for example:

 

'If the is any form of data in column A, to give the date which is in column B'..?

 

Thanks again

 

Steve

Login or Signup to post a comment