Start a new topic

Importing Gifts with 1,2, or 3 solicitors

Hello, ImportOmatic User Community! It's nice to meet you :)

I have a profile that I'm working on that imports gifts into a batch and one of the goals is to have a key field that, if populated, will trigger adding 1, 2, or 3 solicitors to the gift.  I have three dictionaries setup for each of the solicitors ID groups and they get mapped to three separate virtual fields pointed toward 'Gift: Solicitor Constituent or RE User ID' -- it all works fine as long as all three solicitors have a value. (To be clear, it is the contents of the same column that triggers looking in three dictionaries and collecting any matches.)

Any gift in the file that has only 1 solicitor, for instance, will insert 'Solicitor 1; ;' which causes two 'empty solicitors to be added to the gift. When you go to distribute the solicitorship, it causes the error: Required field missing: Solicitor.  I've tried many variations and the best results are working within the code editor as I can skip the look up for any rows that do not have a value on which to perform the lookups.

(Using Regexs to return Blank within the dictionary cause the same results.)

In my last iteration, I'm assigning the results of the "ApplyDictionary" function to a variable and only setting the virtual field value if there are contents in the variable. Still, it causes the blank rows, perhaps just by virtue of there being a virtual field designated for that position.

My next guess is to use the code editor (tomorrow) to concatenate my own string of 'solicitor 1; solicitor 2' and try to insert it into one single virtual field. 

I would appreciate any advice! 

Thank you for the reply, Wayne!

I was able to work through it just now and the error was my side of the keyboard, as expected. This is why I typically don't post to forums :)

Because I am sending a last name to the dictionary, my ApplyDictionary call was returning the same last name to me when there was no match on which to convert to a constituent ID. In my code, I had been testing for null or white space as if the issue was caused by there not being a last name in the import file. The issue was caused whenever there was a last name present yet no match in the dictionary... returning the last name as the potential solicitor ID, which of course does not work :)

I added a regex to the end of each dictionary which turns any string of non-numeric characters into a blank. And that corrected it.

I appreciate your reply as it turned my attention back to the dictionaries.
Hi Chris, it sounds like you have already tried a lot of things which is great!

I am surprised to hear that IOM is creating a blank solicitor even if you don't put anything in the virtual field.  In one of my imports I have a virtual field for solicitor that sometimes is filled in and sometimes not.  I haven't had any problems  with the gifts that do not have solicitors.  That being said, I have not tried with multiple solicitors.

This is what mine looks like, maybe it will give you some insight (Column CF).  In the API I am just setting the .value of that field to be the systemID of the solicitor I want.  I am sure it would be the same if I was using the Constituent ID.

Import.Fields.GetByName("Solicitor").Value = SolicitorSystemID




Login or Signup to post a comment