Spaces at beginning of product tags

Spaces at beginning of product tags

Reliked
Tourist
8 0 4

Hi

 

I unfortunately ran into a situation where I had a make.com task that was adding product tags with a space at the beginning of each tag. So now I am trying to fix this, but I can't seem to make a graphQL API call that only pulls products with the tag that has a space at the beginning, it pulls all products with the tag whether there's a space at the front or not. Does anyone know how I can isolate products that are tagged with a tag that starts with a space?

Replies 3 (3)

ShopifyDevSup
Shopify Staff
1453 238 508

Hi @Reliked,

 

Thanks for your post. We've been having difficulty replicating there being a space at the beginning of tags as the system tries to prevent that from happening in the web admin as well as through the REST and GraphQL API's, which is making it difficult to test querying for them that way. Some questions that come to mind are:

 

  • Do you have more information on how these tags with spaces in front were added? ie. an API call, a CSV import
  • Are you sure they're normal spaces as opposed to some kind of special character?

 

Hope you have a great day

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jtraverso
Shopify Partner
9 0 4

The same thing happended to me using make.com, when  I se tags[] to preserve the tags the customer already has, this integration in adding a space in front of current customer tags.

jtraverso
Shopify Partner
9 0 4

Here is a fix on make.com, instead of using Tags[] to keep current tags, write a string with all the tags: {{trim(split(join(distinct(2.tags); ",") + ","))}}, in this way, tags will be preserved without the extra space at the beginning.