Developer forum

Forum » Integration » Import related addresses

Import related addresses

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

How do I import related address for a user when I don't have the Dynamicweb XML? I receive the following XML for an address:

  <table tableName="AccessUserAddress">
    <item table="AccessUserAddress">
      <column columnName="AccessUserAddressUserID"><![CDATA[W00206]]></column>
      <column columnName="AccessUserAddressType"><![CDATA[1]]></column>

 

The UserID (W00206) on the address is the *external ID* of the user. How do I map this from W00206 to whatever the ID of the user in AccesUser is? Is there a built-in way or do I need a table script?

Thanks!

Imar


Replies

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Just what you showed should work. The AccessUserAddressUserId field will join on the ExternalId of the user if it can't find a match on the actual UserId field, as long as you're using the User Provider.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Except that it doesn't work :-)

This query returns a row:

SELECT * FROM AccessUser WHERE AccessUserExternalID = 'K000002'

yet when I import the addresses, I get errors like this:

2022-09-30 15:27:47.291 Error importing user Address 'Contact Address': No user found with UserID or Auto equal to: 'K000002'  

Are other keys playing a part here? Is the UID of the address relevant?

 

I do use the User Provider and it's set up to import users, addresses, groups and relations.

Any other ideas?

Imar

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

I think I figured it out. I switched the entire job from Auto to ExternalID for the primary key and now it works.

Thanks!

Imar

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Good catch. Sounds like that was the final piece.

 

You must be logged in to post in the forum