Post

1 follower Follow
0
Avatar

Update Contact(s)

We are linking all customers from a magento ecommerce website with the Podio customers app as well as the workspace customers. There are 25000+ customers to be not only imported but updated weekly.

How do I check if customer "X" exists and if so compare the fields and update any different fields; If all is the same, skip; if customer "X" doesn't exist, create etc.

The current code is attached. 

Nick George Answered

Please sign in to leave a comment.

4 comments

0
Avatar

When you need to synchronize items in Podio with external data, we recommend to set the external_id when you add the item. The external id can be any string value - in your case, the customers in magento probably have a numeric id.

If you set the external id of each customer item to this magento id, you can then use Get item by external id to check if the customer has already been created, and then update the existing item on subsequent synchronization runs.

Take care not to hit the rate limits when you do your initial import - you should check how many requests you have left and add appropriate delays.

Casper Fabricius 0 votes
Comment actions Permalink
0
Avatar

Tip about rate limits since I can see you are using PHP: You can use Podio::rate_limit() and Podio::rate_limit_remaining() after making an API call to see your total rate limit and the amount of remaining calls you can make for that particular call.

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink
0
Avatar

Andreas, do the rate_limit() functions appear in v2 of the PHP wrappers?

Patrick Steil 0 votes
Comment actions Permalink
0
Avatar

They do not. V2 will not receive any updates from my hand. You could backport it yourself if you want.

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink