Developer forum

Forum » Integration » Importing users and addresses in one go without userID

Importing users and addresses in one go without userID

Claus Kølbæk
Claus Kølbæk
Reply

Hey

I am running into a problem when trying to import users into the 2 tables AccessUser and AccessUserAddress.

The file contains a unique customernumber which I map into both the username and customernumber on a user, but since some users are created outside the import I cannot use this number as the userID in DW, and therefore leave it blank to be autogenerated.

My issue then is that if I try to leave the AccessUserAddressUserId blank for the import of addresses I get "cannot insert the value NULL", I found another (rather old) thread here: https://doc.dynamicweb.com/forum/integration/integration/importing-addresses which stated:

"if it is an integer value – it looks for the AccessUserID with this value
otherwise or if the user is not found by ID it is searching by the columns: "AccessUserUserName", "AccessUserCustomerNumber", "AccessUserEmail"."

So my problem is that if I use the customernumber in the field for AccessUserAddressUserId then it tries to match against the users with the same ID - resulting in the wrong users getting the addresses. Is there anyway to force it to skip straight to looking at AccessUserCustomerNumber? - or ofc. some other field?


Replies

 
Claus Kølbæk
Claus Kølbæk
Reply

Found a small workaround by prepending a string to the external id when importing it into AccessUserCustomerNumber, now address import picks this field as a string.
Though I imagine only aslong as no users creates themselves with a similar username, and while that is higely unlikely I would still prefer a solution that had no amount of luck involved :)

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Claus,
Have you tried to select AccessUserCustomerNumber in the User key field?

Best regards, Dmitrij

 

You must be logged in to post in the forum