Skip to main content
Best answer

Shopify add tag to customer without replacing all

  • October 6, 2021
  • 1 reply
  • 805 views

Hello,

I want to add a tag to a customer without removing any existing tags. I am sure there is a way to do this using the code by Zapier action (javascript)…

 

So far I am able to get the tags then split them into an array but I’m stuck at this point:

 

var tags = inputData.tags

var arrayTags = tags.split(',');

var final = arrayTags.push("new tag");

final = final.toString();

output = {final,final}

 

Nothing is being pushed to the test user account I have created… Any ideas?

 

Thanks!

Best answer by jayeshkumarbhatiaBest answer by jayeshkumarbhatia

Hey @ElliottF ,

 

Its possible, add below actions. 

 

  1. Action 1 - Find Customer (This action will give all the tags)
  2. Action 2 - Update the customer (In the input, add the tags from Action 1, and than add your new tag comma seperated)

Hope this works!

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

jayeshkumarbhatia
Forum|alt.badge.img+6

Hey @ElliottF ,

 

Its possible, add below actions. 

 

  1. Action 1 - Find Customer (This action will give all the tags)
  2. Action 2 - Update the customer (In the input, add the tags from Action 1, and than add your new tag comma seperated)

Hope this works!