Is there a way to print only the last 4 digits of customer no?

Hi, I’m just wondering whether it is possible to to print only the last 4 digits of customer phone number? for security reason.

Just a hint on what to do is fine, and i’ll try to figure the rest :smiley:
Thanks in advance

Anyone has solution at all?

@emre may know a way. I have been unsuccessful so far.

Hmmm, I initial solution was like this:
1.create another column called “last 4 digit” for Customer entity.
2.use “Update Entity Data” action type to clone “Phone” value, then keep only the last 4 digits and store it in to “last 4 digit”

The problem I am facing is I can’t retrieve customer’s existing “Phone” column and put it is “field value” parameter of “Update entity data” action. :frowning:

It will be possible with a custom expression like:

[='{ENTITY DATA:Customer:Phone}'.substr('{ENTITY DATA:Customer:Phone}'.length-4,4)]

However I wonder how it helps the security. You can prefer not to print phone number at all since deliverer won’t be able to call customer.


Thanks @emre, It works wonder! :smiley: my customer table uses phone as a primary field though so I adjusted the syntax to:
[='{ENTITY NAME}'.substr('{ENTITY NAME}'.length-4,4)]

And to answer your question, It does work for my (very unique?) workflow, like this:

  1. Customer calls us to order take away-pickup
  2. Our clerk keys in the orders & customer name + phone number
  3. We Print Receipt Ticket containing orders + customer name + last 4 phone digits
  4. Ticket is assigned to corresponding order bag
  5. customer come to pick-up, firstly check for name in the ticket, and if there are more than one order with the same name then check for the last 4 digit number
  6. Customer wont have to worry about having both their name and number when disposing the receipt (Yes, I am a bit of a paranoid person)
  7. We still have customer’s number (In POS database) to contact them when needed