Best answer

Pattern matching from Shopify

  • 2 December 2021
  • 23 replies
  • 158 views

Badge

Hello,

I’m hoping you can help me :)

I’m connecting Shopify to my accounting software. All was pretty straightforward, the last thing to get right is the ‘Project’ so I can allocate sales properly.

Each product I have has it’s own project and my book keeping software requires each to have a number prefix - e.g. ‘01 Project Name’

When bringing a product in from Shopify, the product name doesn’t have the ‘01’ infront of it and so the two don’t match-up. 

Is there a way to add a regular expression before product name so that I’m able to get everything connected properly?

Thanks in advance for your help.
Ashley

 

icon

Best answer by SamB 3 December 2021, 16:59

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

23 replies

Userlevel 6
Badge +6

Hey @Ashley Watson ,

 

Did you try adding 01 in start of the product name like below.

 

 

Userlevel 7
Badge +14

Hi @Ashley Watson 

If the leading number will always be “01 ” then you can hardcode a static value as shown above, otherwise you’ll need to add additional logic steps to the Zap to handle the numbering.

Badge

Hi Troy,

 

Thanks for letting me know. The numbers are different for each project. Would you be able to let me know how to set up the logic step to get around this problem?

 

I’ve been looking at adding a ‘Format’ step but am not quite sure how to set this up.

 

Many thanks,
Ashley

 

Userlevel 7
Badge +14

@Ashley Watson 

Can you please clarify the requirements for the leading number?

Is it incremental?

Does it have to start with min of 2 digits? (e.g. 01, 02, etc.)

Badge

Yes the number is incremental. I made a mistake, it starts as ‘1’ and will go up to two digits at 10, three at 100.

If it made life easy, you could start the project numbers at 100? The number isn’t relevant to anything else.

 

Thanks

Ashley

Userlevel 7
Badge +14

@Ashley Watson 

Try using Storage to set/get/increment values: https://zapier.com/apps/storage/integrations#triggers-and-actions

 

Badge

I only started using Zapier yesterday. I’m afraid I’m not sure how to do that. Any chance you could let me know the steps?


Thanks, A.

Userlevel 7
Badge +14

@Ashley Watson

Best way to figure something out is to spend time learning via trial and error.

Check out the available help articles for using Storage in Zaps: https://zapier.com/apps/storage/help

Guide: https://zapier.com/help/create/storage-and-digests/save-and-retrieve-data-from-zaps

Badge

If I wan’t on a deadline I’d agree :)

I’m not sure if this is what I’m after. Am I right in thinking I would save the project names in the store, and then use them when needed?

Is there a way of using a regular expression as a placeholder for the number prefix?

Userlevel 7
Badge +14

@Ashley Watson 

RegEx is for search patterns: https://zapier.com/help/create/format/find-text-with-regular-expressions-in-zaps

 

With Storage, you want to set an initial value (e.g. 0) at a defined Key (e.g. ProjectID).

Then in the Zap, you’ll use the Storage Increment Value (+1) step.

Then you’ll map the returned value to be the leading Project ID number.

Badge

I’m sorry, that goes above my head a bit.


I think that what I didn’t explain properly is that on an invoice, the products won’t appear in the incremental order. So I’m not sure how the +1 will work.

 

e.g.

product - Sweatshirt / project - 11 Sweatshirt

product - Baseball Cap / project - 6 Sweatshirt

 

So they may come in a variety of orders. Does that make sense?

Userlevel 7
Badge +14

@Ashley Watson 

To help us better understand what you are trying to achieve, can you outline a few examples with the provided INPUT values and the expected OUTPUT results?

Badge

Yes sure.

In the ‘Project’ box on the Zap, I can pull through the product name from Shopify. e.g. ‘Baseball Cap’

 

I can create a ‘project’ in my accounting software which has a matching product name. The issue is that I have to give this a number which become the prefix. e.g ‘15 Baseball Cap’

 

For the two to sync, they need to be the same and so I’m looking for a way to remove or ignore the number prefix.

 

Is there a way that I can add something into the zap box before the ‘product name’ which is pulled through from Shopify that allows the accounting software to bypass the prefix and read the project name?

 

Here are some examples:

 

Product: Baseball Cap   /   Project: 15 Baseball Cap

Product: Olive Jacket   /   Project: 5 Olive Jacket

Product: Navy Shirt   /   Project: 8 Navy Shirt

 

I can set the number prefix in my accounting software to be three digits which means the number of digits will be the same for all projects. So these could become:

 

Product: Baseball Cap   /   Project: 115 Baseball Cap

Product: Olive Jacket   /   Project: 105 Olive Jacket

Product: Navy Shirt   /   Project: 108 Navy Shirt

Userlevel 7
Badge +14

@Ashley Watson 

Can you provide screenshots with how the data is provided from Shopify?

Can you provide screenshots with how your Zap steps are currently ordered and configured?

Badge

Yes sure. Here you go:

Userlevel 7
Badge +14

@Ashley Watson

Can you provide screenshots of each Zap step?

 

How do you know what number should be prepended for the Project?

 

Badge

Here you go

Badge

Yes sure - here it is.

Userlevel 7
Badge +14

@Ashley Watson 

How do you know what number should be prepended for the Project?

 

This looks like a lookup table, meaning the ID for each Product are in the left column and the Name of the Product is in the right column.

 

If there are 1+ Products in a Shopify Order then you’ll have to handle line items to get the Project ID for each Product Name.

 

Looping app can help with that but it’s more advanced: https://zapier.com/apps/looping/help

 

Userlevel 7
Badge +11

Hey @Ashley Watson!

It seems like you need to set up a lookup table to convert the product titles we receive from Shopify into the ID value that IRIS Kashflow expects for the project.

You can use a Formatter (Utilities > Lookup Table) to create the lookup table. As it supports line items, you should be able to select the “Line Items Title” field from the Shopify step for the Input field and it will output the corresponding IRIS Kashflow project ID number for each line item.

So if the project ID that IRIS Kashflow is expecting is a number as per the ones shown in your previous screenshot then you’d set up the lookup table like this example:

b8d943032d7a29422590bb4726e7d37c.png

So the values on the left are the product titles you’d expect to receive from Shopify. And the values on the right are the corresponding project IDs that IRIS Kashflow expects. So KILLIAN VEST would convert to 21. 

You can find out more about setting up lookup tables here: Create lookup tables in Zaps

Hope that helps! :)

Userlevel 7
Badge +14

@Ashley Watson 

If you still need help, consider hiring a Zapier Expert: https://zapier.com/experts

Badge

Hi @SamB,

That’s such a great approach - thank you for sharing :)

I’ve set the up and for some reason, the invoice in Kashflow still doesn’t seem to connect this to a project. The table is changing the value perfectly, I’m wondering if there’s a different way of recoding the value so that it picks up in Kashflow?

I’ve attached a ‘cleaned-up’ project list + how these look when they come through into the invoice.

Any help is much appreciated.

Thanks,
Ashley

Badge

@SamB Sorry - here are the pics.