Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Shopify Flow Automation help - Metafield Automation

Shopify Flow Automation help - Metafield Automation

vsardovski
Shopify Partner
1 0 0

The main idea of this automation is to copy the values of the dynamic metafields to the statick single line string metafields.

Is it possible this flow automation:

Shopify Flow:

  1. Trigger - Product Update:

    • Set the trigger to detect when a product's status is updated or product updated (which is not available as an option from the Shopify Shop Flow options)
  2. Get Product Metafield Data:

    • Use the "Get Metafield" action for each relevant metafield:
      • custom.style
      • custom.art_theme
      • custom.rooms
      • custom.color
      • custom.format
    • Store the retrieved metaobject list entries for further use.
  3. Check and Copy Logic for Each Metafield:

    • For each metafield (Style, Theme, Room, Color, and Format):
      • Condition: Check if the metaobject entry list exists or is not empty.
      • Action (Copy): If the condition is met:
        • Copy the value(s) from the metaobject entry list to the corresponding list text metafield:
          • custom.style_category for custom.style
          • custom.theme_category for custom.art_theme
          • custom.room_category for custom.rooms
          • custom.colour_category for custom.color
          • custom.format_category for custom.format
        • Use the "Update Metafield" action to store the copied entries in the list text metafields.
  4. Update Artist Metafield:

    • Use the "Get Product Details" action to retrieve the vendor value.
    • Use the "Update Metafield" action to update the custom.artist metafield with the vendor's value.

Flow Logic Diagram:

  • Trigger: Product status updated
    • Action: Get custom.style metafield
      • Condition: If metaobject entries exist
        • Action: Copy entry to custom.style_category
    • Action: Get custom.art_theme metafield
      • Condition: If metaobject entries exist
        • Action: Copy entry to custom.theme_category
    • Action: Get custom.rooms metafield
      • Condition: If metaobject entries exist
        • Action: Copy entry to custom.room_category
    • Action: Get custom.color metafield
      • Condition: If metaobject entries exist
        • Action: Copy entry to custom.colour_category
    • Action: Get custom.format metafield
      • Condition: If metaobject entries exist
        • Action: Copy entry to custom.format_category
    • Action: Get Vendor
      • Action: Update custom.artist metafield with Vendor's value
Reply 1 (1)

RPiii
Shopify Staff
89 16 33

Hi @vsardovski. I don't think you need any of these "Get" actions. The way to do this might be to start with a Product status updated trigger then branch out the conditions to see if the relevant metafields exist on the product returned by the trigger and then follow each conditional branch with an Update product metafield action configured to update each relevant metafield with the previous metafield value using a Liquid expression in the value field on the action.