Fix invalid rule error

Is the app showing an invalid rule error like the image below?

invalid rule error

This knowledge article shows that triggers the error and how to fix it.

What is an “Invalid rule” error? #

“Invalid rule…” error occurs when the app cannot match the product’s stock with any threshold rules configured. See the below example, which shows the following threshold message rules configuration:

  • THRESHOLD MESSAGE RULE 1: Less than or equal to “0” → Show “Sold out” message
  • THRESHOLD MESSAGE RULE 2: Less than or equal to “4” → Show “Low stock” message
  • THRESHOLD MESSAGE RULE 3: Greater than or equal to “10” → Show “High stock” message

Based on these rules, if the product has a stock of 6, it doesn’t meet any of the criteria because it’s neither less than 4 nor greater than 10. As a result, the app doesn’t know what to display and shows an “Invalid rule” error.

How to fix the error #

Update your threshold rules to ensure that the numbers are in consecutive order. For example, to fix the above rule, change “Inventory is greater than or equal to” to 5 under THRESHOLD MESSAGE RULE 3.

What are your feelings