For the complete documentation index, see llms.txt. This page is also available as Markdown.

Complex Effects (if, else)

We want to set the the granted points to twice the amount member spent in transaction that triggered the campaign. We also want to set a point limit for transaction to 100 - we want to avoid the situation when the member spends a lot in one transactions, and gets more points than he can spend for the rewards. We can use Open Loyalty language, and set following effect:

(transaction.grossValue * 2 >=100) ? 100 : transaction.grossValue * 2

Which means that if the transaction value multiplied by two is smaller or equal 100, than user will get the multiplied value of points, if it is bigger - user will always get 100 points. This way, we can create a campaign that is triggered by all transactions, but all transactions above the 50 value will result in 100 points given to the user.

Last updated

Was this helpful?