How to Run a One-Time Product Rule with Tags
You can use Ablestar Bulk Product Editor to create a custom Product Rule, with two methods:
- Recurring: these run repeatedly on each product update.
- One Time: these will run only one time on creation or when modified.
However, some store owners need the ability to run the rule only once, not on every update and not during creation.
We want to avoid situations where you intend to replace the word "Ablestar" with "by Ablestar" in a title every time a product publishes. If you use the default product rules you will end with "by by by by by Ablestar" after a couple runs of the rule, because the rule reapplied during each update.
Tags can be used as a third strategy.
Tags serve as indicators to determine if a product has been set up correctly or if it has undergone previous modifications. By employing tags strategically, users can ensure that a product rule is executed only once, either during creation or subsequent updates.
To prevent the loop and execute the product rule only once, follow the steps below:
1. Identify Unmodified Products
Start by creating a rule that targets products without the designated tag indicating previous modifications. This rule ensures that the modification is applied only when the product has not been processed before.
2. Configure the Rule
Within the rule, specify the modification to be performed. For instance, if you want to add text to the end of the product title, define the necessary action accordingly.
3. Add a Tag upon Modification
To indicate that the product has been modified, include an additional action within the rule to add the designated tag. This step helps identify products that have undergone the modification process.
4. Save and Enable
Save the rule configuration and enable it within the Bulk Product Editor app. Whenever a product is updated on Shopify, the app checks if the designated tag exists. If the tag is present, the product is ignored. If the tag is absent, indicating it is the first time the rule encounters the product, the modification is made, and the tag is added.
By utilizing the tag-based approach described above, the Bulk Product Editor avoids loops and ensures that product rules are executed only once per product.