How do I map and extract data from WooCommerce to Xero based on specific conditions?
Hi All,
I’m fairly new to Zapier and think this is probably going to be quite simple, but I’m not sure what to search for to find a help article. I am sending data from WooCommerce (new completed order) to Xero (New Sales Invoice). One of the fields I am passing is some meta data from our events booking plugin, Amelia. Our customers are booking weekly classes in historical fencing. Each of the classes is generally known, but there is some unknown variation.
For example;
Input
Output
Class Name
Weapon
Longsword
Longsword
Longsword - Beginners Course
Longsword
Longsword (reserved)
Longsword
Park Sparring
Other
Rapier
Rapier
Sabre
Sabre
Sabre -( Grappling session)
Sabre
Sabre (Including New Starters)
Sabre
What I am after is a mapping step such that if any of the possible values for “Weapon” are contained in the string for “Class Name” then to Output that weapon, otherwise to Output “Other”. Can someone point me in the right direction for how to do this?
Dan
Page 1 / 1
Hi @powelly0
Good question.
Try using this Zap action: Formatter > Utilities > Lookup Table
Thanks @Troy Tessalone, however I think a lookup table would require all of the possible values to be known, whereas there will be new values created which will follow the same rules, but all possible values cannot be known in advance.
@powelly0
You would likely need to create some sort of logic to apply or lookup table to reference.
I was going to propose just taking the first word of the INPUT, but there’s an exception...Park Sparring > Other
Plus, you’ve mentioned there are more options on the list and that those options can shrink/grow/change.
Yes, the logic is if INPUT string contains any of the values in a list (Sabre, Rapier, Longsword; non-case sensitive) then return that list item, else return “Other”. But I don’t know what tools to use to set up this logic in zapier.
@powelly0
Why not simply update the Lookup Table once the new values are added/removed/changed?
however I think a lookup table would require all of the possible values to be known, whereas there will be new values created which will follow the same rules, but all possible values cannot be known in advance.
It’s an option, but would require a good deal of maintenance because of the volumes. The above table is just a small sample of possible values.
Since we do have a logical rule, there must be a way of implementing it? The logic is;
IF INPUT contains (x or y or z) then return z/y/z, respectively.
Maybe something can be done with wildcards in a find and replace?
@powelly0
Here’s what you probably want to do...manage this in WooCommerce with Categories, Tags, or Attributes.