Shopify flow to remove part of product.descriptionhtml and update metafield

BenBritton
Tourist
4 0 2

Hey hoping someone can assist in removing part of a html formatted description to update a metafield. We have done a similar thing with tags but struggling with this.

 

Example part of description:

<div class="Care Instructions">

<p>Cold Wash</p>

<p>Do not tumble dry </p>

<p>Do not iron</p>

</div>

 

Ideally the flow would update custom.care_instructions metafield to multi line text:

"Cold Wash

Do not tumble dry

Do not iron"

 

And strip from product description:

<div class="Care Instructions">

<p>Cold Wash</p>

<p>Do not tumble dry </p>

<p>Do not iron</p>

</div>

 

any help would be appreciated 🙂

Reply 1 (1)

paul_n
Shopify Staff
922 127 221

I've never tried this command, but maybe use the tag strip_html. See https://shopify.github.io/liquid/filters/strip_html/

 

Something like {{ product.description | strip_html }}

 

Let us know if that works for you

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.