Flow | Correct syntax for using metafields in openAI text generation

Hi there,

I want to use openAI text generation in order to generate a biography of famous people. The idea is to customize the prompt with metafields variables that contain first- and lastname information of the person.

Background. We run an autograph store with unique items.

so this is my current prompt

Write a 500 words and 6 paragraphs biography text about

{{ product.metafields.customAttributes.vorname }} {{ product.metafields.customAttributes.nachname }}

without a title formatted in HTML only with

tags

The prompt works fine without the metafield variables. I tried some variants in syntax but shopify keeps saying

“customAttributes” is invalid. Replace this variable.

So what would be the right syntax?

Thanks for your help folks

Florian

That syntax does not currently work for metafields in Flow. Also, “customAttributes” are not the same thing as metafields.

There are many threads showing how to access metafields using a loop or “where” clause. Here’s the where clause method for a different type of metafield:

https://community.shopify.com/post/2021617