Using data read from an RFID card

I want to use an RFID card to retrieve stored customer data and use it to initiate a discount at time of payment. One of the fields (CardValid) in the Entity custom data holds value Yes, No or Null.

From the payment screen the card is scanned and the data retrieved via a Change Ticket Entity action

There are then a list of actions which should be triggered by the value of the CardValid field using constraints on the actions, e.g.

This all seems to work OK except that it uses the values from the previous card scanned rather than the current one, i.e. if two cards are scanned with CardValid = Yes and No respectively, the actions will operate on the Yes value rather than the No value. If the card is then scanned a second time, the expected (correct) results are obtained.

If i add a message to show Entity Name and Entity Data, the message indicates all is well and shows me values of the current card.

Does anybody have any suggestions as to what is happening here and how to correct it?

Where is your load entity action? Oh nm your not doing that. Ok so it’s reading the assigned entity which is what you told it to do. Try loading entity from card first.

I tried that using Load Entity in place of Change Ticket Entity

Also tried to load it after the Change Ticket Entity

But still have the same problem. I read somewhere on the forum that we cannot use Load Entity on an open ticket. I assume the ticket is open if we are in the process of paying it (but maybe not?)

You can use load entity almost anywhere. Maybe try the Execute Ticket Command and refresh the ticket.

If it’s at payment screen then that’s why. You can’t execute that change while at payment screen.

The discount needs to be applied at the time of payment because that’s how the staff have been doing it for several years and trying to retrain them is just too hard (the RFID card is a new thing). I’m a bit confused because if I read the values into a message

it shows what I would expect, but when I use the same parameters in a constraint, it uses the values from the previous ticket.

What event are you using for show msg? And what event are you using for the discount?

No event. It is the action after the Change Ticket Entity in the rule

Maybe you don’t understand me. What rule event are you using

OK sorry. The rule is an Automation Command Executed which is a button on the payment screen to apply a 10% discount to the ticket

So when is card scanned and what rule are you using for it?

The first post shows the Change ticket Entity. This is the first action when the discount button is pressed. The card is scanned to get the [:CardNumber] variable via a numberpad popup

Yes you have showed that already. So your pressing an automation command button and its bringing up the prompt to swipe the card?

Remember we cant see your system… we dont know what you have setup. YOu have not shown the rule just a cutoff showing the actions inside the rule. I need to understand every step your doing to help you.

That’s correct. And if I then display the values via the message they appear to be what I would expect

Ok so your trying to change Ticket Entity from inside Payment Screen? THe show message I assume is just reading the swiped card?

I am. The ticket entity NAME changes as expected so that part is working

How do you know it changed?

I can see it on the ticket after the payment screen is refreshed. This was at the end of all the actions so I thought that may be the problem so I added a Refresh Payment screen Action after the Change Ticket Entity and before the message. It shows the Name is updated

Ok so I dont have to keep asking you questions… can you share the whole setup without cutting off anything in the screenshots.

While Im waiting on you to show us the screenshots I have a question. Does your card actually have a Null value? Or is it just empty if Yes or No is not in it?