Pulling a specific customer Tag from Shopify

Comments

3 comments

  • Sree Vani Amara Principal Product Manager
    Engaged
    Answer Pro
    Celigo University Level 4: Legendary

    Hi Shadner Joseph

    You can add a transformation to extract the value of the Klaviyo ID. sample screenshot below. 

    {{substring tags (regexSearch tags 'Klaviyo ID:([^\\s]+)') (add (regexSearch tags 'Klaviyo ID:([^\\s]+)') 38)}}
    0
  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Shadner Joseph to build on Sree Vani Amara's response, if you don't want the "Klaviyo ID: " piece of the string, since I assume you need just the id to map to Klaviyo, you can use the below handlebar expression. This will extract just the id, works if the tag is beginning, middle, or end of the tag string, and doesn't rely on hardcoded string lengths in case something changes down the road.

    {{regexMatch tags "(?<=Klaviyo ID: )([A-Za-z0-9_-]+)" 0 "g"}}

    0
  • Shadner Joseph

    Tyler Lamparter and Sree Vani Amara

    Thank you so much!

    0

Please sign in to leave a comment.