I am trying to remove a ‘Date To’ from Constituency code through regular expression.
We use ‘Constituent Code Date To’ to end if the supporter is no longer an active and want to remove the Date To when supporter is active again. Not sure how to do this. Anyone have any ideas?
It's not difficult to create a RegEx that blanks out incoming values in the import.
But have you first tested to see -- what happens if you try to use Omatic to update some existing Constituency Codes where, in the RE record the DateTo has a value, but in the import file the DateTo is blank?
You may want to test that because I don't think having a blank date in the import file will cause the existing value on the record to be removed. (And that's all the regular expression can actually do -- just modify the incoming import value to make it be blank.)
To achieve the result you might be able to set something up where one row of the import file removes the entire constit code (with "-" at the start of the constit code to be removed, and then a second line re-adds it but without the end date.
Depending on the total number of the constituents you need to change and number of different constituent codes on each one you want to affect it seems like a toss-up between that approach (delete constit code, re-add) and doing a Global Update (RE -> Admin -> Globally Change Records). The catch with the Global Update is you would probably first need a "do nothing" import to allow you to create an RE static query that matches the set of constituents you want to change.
(A do-nothing import is where you go to RE -> Admin -> Import -> Constituent -> New and then you set up the import with the minimum it needs to successfully look up existing records (I believe it's
( [Constituent ID] OR [Constituent Import ID] ) AND [Key Indicator], and then you don't actually have it do anything to those records. But over on tab 4 of the Import, you click "Create an output query of the records imported" so that after you've run it, there's a brand new query in the system matching that set of records.
About the original question: to create a Dictionary that blanks out incoming values: In replacement values, click "+". That creates an entry "-- BLANK --". Click on it to select it. In Values to match on, type
".*" (without the quotation marks)
click the "+" on the right.
Click the check box "Use Regular Expressions"
I didn't try this, but you may be able to set the constituent code settings to update the "date to" to blank.
I try to stay away from codes that are based on other data (i.e. active/current donor) because errors can always be made. You're better off using the actual data (i.e. last gift date) to decide if they are active or not.