Solved

Updating Custom Metafields : adding values

Cleronhigh
Shopify Partner
6 1 1

So i created a workflow where i want a custom integer customer metafield to update its value by 1 (or whatever number) 

 

however i cant seem to make it work. if i put something like {{ 1 | plus: 1}} it ofcourse always will set the values to two. something like {{ value | plus: 1 }} returns an error. is there something obvious i am missing ? any help would be appreciated 

 

 

 

 

workflow.PNG

Accepted Solution (1)
paul_n
Shopify Staff
1009 133 240

This is an accepted solution.

Your namespace is likely not customer but custom or something else.
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 5 (5)

paul_n
Shopify Staff
1009 133 240

Start by sharing the error that you are getting. Do watch out for excess white space by using hyphens like 

{{- foo -}}
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.
paul_n
Shopify Staff
1009 133 240

For accessing the current value, click "add a variable", and choose order / customer / metafield. Then choose the metafield to set up an "alias". Docs are here on this new feature: https://help.shopify.com/en/manual/shopify-flow/reference/metafields#get-metafield-data

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.
Cleronhigh
Shopify Partner
6 1 1

Thanks for the quick help, i did it like this now, the workflow suceeds but the value doesnt actually change. 

 

zdkkk.PNG

paul_n
Shopify Staff
1009 133 240

This is an accepted solution.

Your namespace is likely not customer but custom or something else.
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.
Cleronhigh
Shopify Partner
6 1 1

that was it, seem to have changed it to test something but forgot to change it back, thanks for the super quick help!