Order tags containing a "."

Because SambaPOS doesn’t take a standard approach and use the database ID as the “primary field” I have had to use email address as the primary field for my customer entites (other wise it wouldn’t be possible to have two customers called “John Smith”).

Using email address should work OK, but when it comes to my commission system, I need to have order tags with the order tag name matching the entity primary key. But, when I use an . symbol in the order tag name the entire order tag doesn’t appear as a selectable option.

Hmm… the DOT is a “SubTag” or “modifiers of modifiers” feature that was added with the debut of V5, so that is why you are having a problem with Tag Values containing a DOT.

Not sure how many people uses this feature, but it can be useful, and it was a request for something that resulted in this:

1 Like

Maybe there is a way for you to use the Order Tag Description?

This Report Tag will show the Description field:

{REPORT ORDER TAG DETAILS:O.MenuItemName,T.Name,T.Description}

Hmmm - So I guess there’s going to be no way to overcome this. Maybe I will just hard code an additional .com in the rule.

I don’t think so, because I am using a rule that is triggered for an entire order, not each individual order tag, therefore I am using ORDER TAG LIST to read all the commission names and I don’t think there is an equivilant ORDER TAG DESCRIPTION LIST?

Did you try escaping the .?

Good idea.

Just tired john@fake\.com but no luck :frowning:

1 Like

Try putting it in quotes? Sometimes we find hidden features this way.

Nope - That doesn’t work either :frowning:

Not everyone is a .com though…

Not likely. But we know with SambaPOS, when there is a will there is a way. So maybe you need to change your processing.

It’s OK, because these tags are only for my staff. I end up with a list of staff names who could have sold any particular item, but I need to link these tags the entity for the staff member. All my staff members who can recive commission have an email address stored of staffname@companyname.com - So fortunately I can hard-code this :wink:

Maybe try some Jscript that outputs the email? An expression? I never tried it in tags.

Nice idea, but it will probably just break something else further down the line, so happy enough hardcoding the .com for now.

Thanks for the ideas though :slight_smile:

{REPORT ORDER TAG DETAILS:O.MenuItemName,T.Name,T.Value,T.Description:(OT=Email)}

Yes, but after your suggestion the other day I am changing all order states when the ticket gets paid then using this trigger to go through the orders one-by-one, as part of the order I have direct access to {ORDER TAG LIST} so I figured that made sense to use. I’ll take a look at this option…

If I only want to retireve one of the email addresses at a time, is it possible to get the report to return only the 1st, 2nd or third result? Or would I need to send a CSV output to some JScript to split the result?

I would really need to see your setup to offer good suggestions. But we can do some pretty funky things using just [=expressions] and inline JScript … something like the following might work in an Action as a parameter - I don’t know:

[='{REPORT ORDER TAG DETAILS:T.Description:(OT=Email) && O.MenuItemName="{NAME}":,}'.split(',')[0]]
[='{REPORT ORDER TAG DETAILS:T.Description:(OT=Email) && O.MenuItemName="{NAME}":,}'.split(',')[1]]
[='{REPORT ORDER TAG DETAILS:T.Description:(OT=Email) && O.MenuItemName="{NAME}":,}'.split(',')[2]]

EDIT: does not work as expected… it breaks the parser because of the nested [0] resulting in an output of just “]” … at least it does in Report Preview. The theory is sound however :stuck_out_tongue_winking_eye:

Yeah, that’s that sort of think I was thinking, but before when I tried to access an array using square bracks inside a [= ] I couldn’t seem to get it to work. Maybe I left a typo in there… I’ll give it another go…


Yeah, this doesn’t seem to work inside [= ]

I tried using 3 different Show Message actions, I have indicated the resulting outputs too…

[='{REPORT ORDER TAG DETAILS:T.Description:(OT=Commission) AND O.Id=[:CommandValue]:,}']
Output: dave@diveshop.com,caro@diveshop.com

[='{REPORT ORDER TAG DETAILS:T.Description:(OT=Commission) AND O.Id=[:CommandValue]:,}'.split(',')[0]]
Output: ]

[='{REPORT ORDER TAG DETAILS:T.Description:(OT=Commission) AND O.Id=[:CommandValue]:,}'.split(',')[1]]
Output: ]

Any ideas? I had a similar issue with the CSV output of ORDER TAG LIST and that’s why I wrote small script to do the splitting via a CALL, but it would be nicer is it could all be done in one place…

Nope. That is part of the problem when we come up with this stuff. No way for Emre to predict how we are going to use something. He could probably fix it, but I don’t see it happening soon.

1 Like

I tried to use the REPORT tag above, but because of where I need to use it (nested inside another report tag) unfortunately it didn’t work.

But it’s OK, hard-coding the .com should work for now.

I am not sure if this help (I didn’t read the whole thing).
Can you use middle dot · instead of dot . in order tag. And use replace to inter change it.

1 Like