If you need all possible choices, that refers to the metafield definition (validations), not the current value. Accessing definitions/validations may require GraphiQL/GraphQL and could be costly due to API limits.
Context and intent:
The goal is to pass selected metafields (e.g., style1, year, season1, special, waist, closure, pattern) as variables into the AI prompt to generate product descriptions.
Status:
A concrete Liquid solution for retrieving specific metafield values was provided.
Questions about extracting all validation choices remain open; screenshots illustrate the metafield UI but are not essential to the Liquid approach.
You might not need a query for this. When should the workflow run? Once you have a product in the workflow, you can access all of it’s metafields in liquid directly in the OpenAI action
Then I need to pass exact metafields variables to the Ai prompt here, not just one specific value, to generate a product description based on different parameters Metafield1, Metafield2, Metafield3, and so on:
I’m not sure what you mean by “variables”. I think, b/c of that screenshot, you want all of the possible values for the metafield in that Open AI prompt? That isn’t a metafield value, but I think a metafield definition. I think the choices are stored in validations. You might need to use GraphiQL or a GraphQL client to find the right key name to use for that. Also, you may run into an API limit as query metafields this way is very costly.
Variables are metafields: like the one I show on the print screen, how do I add “product.metafields.my_fields.pattern” to the place Metafield1, as I show on the print screen?
What exact piece of code do I have to add to that place?