Change Product URL with HTTP request in Flow

Solved
jake_mitchell
Shopify Partner
117 2 47

Hi, 

At the moment we are using template product listings which are duplicated and edited to list new items. 

If the person listing them doesn't change the title when duplicating the URL will be e.g. /copy-of-template 

 

jake_mitchell_0-1690823938914.png

 

I was hoping to use Shopify flow to look for any product listed where the URL contains 'copy-of' and to then change the URL with a HTTP request.

 

It doesn't look like this is possible with https://shopify.dev/docs/api/admin-graphql/2023-07/mutations/productUpdate

Am I missing something...is there a way to do this? 

 

Accepted Solution (1)
paul_n
Shopify Staff
Shopify Staff
603 97 154

This is an accepted solution.

I think that field is product / handle

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.

View solution in original post

Replies 3 (3)
paul_n
Shopify Staff
Shopify Staff
603 97 154

This is an accepted solution.

I think that field is product / handle

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
jake_mitchell
Shopify Partner
117 2 47

Thanks Paul. Yet again, you've helped us out no end.

Shopify flow doesn't like handleize as a filter so I'm using this instead. 

{{ product.title | strip | replace: " ", "-" | downcase }}

I think that does broadly the same thing as handleize does. Don't suppose you're able to say yes or no to my thinking there?

paul_n
Shopify Staff
Shopify Staff
603 97 154

Flow uses a more vanilla version of liquid than storefront liquid. If you have any special characters you might also need to encode them: https://shopify.github.io/liquid/filters/url_encode/

 

 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.