Automate Adding Image To Variant Metafield

Topic summary

A user wants to automate adding product images from Shopify’s content/files to product variant metafields, with images named by SKU (e.g., SKU_2 for additional images).

Current situation:

  • Web developer claims this cannot be done in Flow
  • Need to batch update 35-50 products at a time
  • Images are stored in product metafields
  • Manual triggering is acceptable

Proposed approaches:

  • Flow checks product SKUs → finds matching filenames → attaches to metafields
  • OR Flow checks new file uploads → matches to product SKUs → adds to metafields

Technical challenge identified:
A respondent notes there’s no Flow query available to retrieve a list of image filenames, which appears to be a fundamental limitation.

Open to alternatives:
User is willing to consider custom scripts that integrate with Flow or third-party apps that could work alongside Flow if a pure Flow solution isn’t feasible.

Status: Unresolved - seeking technical workarounds for the file query limitation.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

I would like to automate adding newly created images that have been added to Shopify’s content>files, to the correct products. Images are named according the product’s SKU. Additional images for the same product have a suffix such as _2 to indicate image placement.

Typically I’d have tested out some ideas, but I’ve been locked out of Flow by the web-developer, who insists this can’t be done. I’ve made a number of complicated Flow’s in the past, and suspect there is a way, even if that solution isn’t necessarily straight-forward.

The trigger is a non-issue for me, it could be manually triggered every time for all I care. I need to be able to batch update products and there images anywhere between 35 and 50 at a time. Currently, product photos are added to metafields. So this Flow needs to look at the SKU of each product, find the corresponding file names, then correctly attach those files to the product via a metafield. Or it could be done in reverse, where the Flow looks at newly added files and their names, finds the corresponding product SKU, then adds the file to the metafield.

Creating a script (that works with Flow), or using an app apart from Flow that may be better or can work in conjunction with Flow are reasonable solutions if this honestly can’t be done in Flow alone.

1 Like

I’m not sure how you would currently get a list of the file names for the images via Flow. There isn’t a query for images that I can find.