I would like to do something with the variant id when a variant id is added. My action is set up with the following:
[[settings.fields]]
type = "product_reference"
required = true
But that only provides the product reference. I am not sure how to access the previous step’s output (from product variant added)? Can someone point me to the right documentation or some code to access the data in the payload?
I tested with the ‘Log Output’ and ‘Run Code’ block and clearly the variant is available. I just want to be able to use the variant id in our own action and I can’t figure out how to do this from the documentation.
[[settings.fields]]
type = "single_line_text_field"
key = "variant"
name = "variant"
description = "{{productVariant.id}}"
required = true
I ended up getting the idea to add a field and ask the user to add ‘{{productVariant.id}}’. I wish there is a way to do this without having to ask the user to enter value. Maybe by hiding the field with a default value and also without relying on liquid code… something similar to the ‘Run Code’ block input.
Sorry for the delay in responding. Yeah, this will work, with the downside that Flow doesn’t automatically fill in it for merchants. We do want to add more sources like variants to our actions, so this they can be auto-filled