How can i get a value for use it in a Rule

Hi I use V4, that work great, but a have a problem when i want to apply a discount taking the value of customer.

i do this
create a new custom field

then i create an action

and finally the rule

here is the problem because i dont know how can i get the value of the customer.

Custom Data contains NORMAL?

The tag you need is {ENTITY DATA:Discount}, you will want to set a constraint on the rule to Entity Type is Customer so that it doesnt try to look for Discount value on table etc.

1 Like

@Adan, you need to read some Tutorials. You cannot just arbitrarily enter text and values wherever and whenever you feel like it, especially in Rule Constraints. You need to use valid values and syntax.

Do yourself a favor and create this Action - you will use it for Troubleshooting and informational purposes:

##Show Message Action


Here is the Entity Type Definition and a sample Customer Entity:


Now set up your Rule like the following, to find out which variables, parameters and Tags you have access to and those which you do not, or are simply not valid at all …

messageToShow:
Customer:{ENTITY NAME:Customers}\rVIPLVL:{ENTITY DATA:Customers:VIP Level}


This is the result:


Now let’s change your Update Ticket Calculation Action to use [:parameters] so it becomes flexible in it’s use…

Add it to your Rule:

My Custom Data for VIP Level contains one of the following values: 0,1,2,3. So according to the Rule above, if the Customer has VIP Level 1, they will get a 5% discount (1x5). If they are level 2, they get (2x5), or 10% off, and if level 3, they get (3x5) which is 15% off. If they have Level 0, or the VIP Level is empty/undefined, then they receive no discount at all.

Obviously, if your Entity Data contains some different values, such as Text like Normal, Good, Great, etc, then you need to change the way you derive your Calculation Amount.


Here is the result for a Customer with VIP Level 1 …

1 Like

Also as @QMcKay showed in his post Remove Calculation should be set to False if you want to actually create a calculation.