Re: Use of Liquid variables in an IF condition

Solved

Use of Liquid variables in an IF condition

Ed_Graham
Excursionist
17 1 0

I would like to use Liquid in a Shopify Flow IF condition. Is this possible? If so, where should I enter my Liquid logic? (See image below.)

 

Shopify3.png

 

My workflow is scheduled to run every Monday: but I only want it to proceed if the following day (Tuesday) will be during the first week of the month (so 1st - 7th inclusive); otherwise I want it to quit. The default schedule-based triggers aren't sophisticated enough to do that, so I am trying to create the same effect with an IF condition.

Accepted Solution (1)

paul_n
Shopify Staff
1729 190 400

This is an accepted solution.

You can't use liquid in the condition, but you can before the condition using Run code. In fact there are some examples here that are similar to your use case:

 

https://github.com/Shopify/flow-code-examples/tree/main/run-code-examples

 

Which is linked to from this page:

https://help.shopify.com/en/manual/shopify-flow/reference/actions/run-code

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 2 (2)

paul_n
Shopify Staff
1729 190 400

This is an accepted solution.

You can't use liquid in the condition, but you can before the condition using Run code. In fact there are some examples here that are similar to your use case:

 

https://github.com/Shopify/flow-code-examples/tree/main/run-code-examples

 

Which is linked to from this page:

https://help.shopify.com/en/manual/shopify-flow/reference/actions/run-code

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.
Ed_Graham
Excursionist
17 1 0

Thanks Paul - I didn't know about the Run code action.  I'll investigate.