I have a Flow that runs when the membership product is purchased. I am attempting to update the “yearJoined” metafield, which is of type integer. This is what I have in the body of the “updateCustomerMetafield” action:
But it keeps throwing the following error: Exception: Got error updating metafield: “Value must be an integer.” For value: " 2026\n", Type: number_integer
I know it must be an integer. That’s the point of the strip and plus:0 filters.
@susanweber The error is happening because the value being saved contains whitespace and a newline. Even though it looks like a number, Shopify Flow is strict — a number_integer metafield must receive a pure integer, not a string with spaces or line breaks. Please try this.
Thanks so much tim_1, your answer makes a lot of sense. I’ve installed your version 1, and will mark your answer as the solution as soon as the flow triggers and runs successfully.
Confirmed, tim_1 posted the correct solution. Thank you SO much, Tim! This has been a back-burner issue for me for the last 18 months. Such a relief to finally get it working haha. Much appreciated