Switch User / BAR TAB integration

Thats how i did mine :slight_smile: sorry if i wasnt so clear before

2 Likes

Sorry to bump, but between this and the other question I had ive integrated the two and they don’t like eachother…

Can you see any problem here?

Edit, ive used all of these for the Rules… just showing an example

Edit, Ive just changed the rules to NOT MATCHES still wont switch or close

Matt

You cannot close a Ticket if it does not have an Entity Assignment, unless it has a Ticket Tag.

so you could add another action to the rule above that assigns a ticket tag of Switch User when you press your SU_Switch User Button

1 Like

Just to add, I’m assigning it to a table.

Scenario is, if I assign a ticket to a table then use switch user then itll log me back in showing the table I had just created.

I am assigning it to a ticket.

Ill check that rule you just said though… that may work

Matt

Ok I did that and then set it to only show if {TICKET TAG:Switch} is NULL

but its put me in a loop.

I don’t get it… surely if I didn’t want the table to show on switch, my original constraint should work?

{ENTITY NAME:Table} is NULL

Try using your entity table constraint but instead of being is. NULL You could use not matches and then add your table numbers separated by a pipe, for example

{ENTITY NAME:Table} not matches 1|2|3|4

Bit of a ball ache listing all your tables but see if that works, if it does theres probably a way to do it without listing them all

Try it with just one table number first to see if the constraint works, then create a ticket using that table number and see if the switch user now works

Or could you use { ENTITY } not equals or matches Table instead of using entity name?

Remove the Entity Constraint.

Put a Show Message Action in the Rule to see if it is firing and put {ENTITY NAME:Customers} (with ‘s’) and {ENTITY NAME:Customer} (no ‘s’) in the message.

I am also confused as to why you have an Action named SU_Switch User button in your Rule. What does it do? Is it calling the same Automation Command Name that the Rule is for? If so, you could case an infinite loop if your Rule Constraints are not carefully planned and met.

Tried it with just Table 1 and it still logs into the user and shows the table.

Tried with ENTITY not matches/equals and it does the same.

When I settle a ticket it opens the settled ticket and wont let me out of the screen till I press close, when I log back in it takes me to the settled ticket again, stuck loop. Happens on both instances above.

@QMcKay

Rule is firing because it works with the bar tab constraint within the rule I have running works perfectly. The SU_Switch User Action is a log out action, I have changed the name to reflect this and avoid confusion.

Its only a small village pub, If I cant get this working then ill just scrap the Tables and use Bar Tab only. If they never had it they never knew it existed right?

Matt

I say that yet the bar tab isn’t working now…

I wonder if ive broken something in the process, might delete everything and start again.

EDIT: yes it does I just needed to close and reopen samba

Matt

Right, ok so the Rule is firing. Still put a show message action in there as I suggested to ensure you are reading the entity properly.

That was the point of my post - to see what is available to use as a Constraint, but you must remove the Entity Constraint first.

The Show Message Action is your #1 troubleshooting tool :wink:
The Rule Debugger is your #2 troubleshooting tool.

1 Like

ok will do now be right back!

EDIT:

So I did {ENTITY NAME:Table} and {ENTITY NAME:Tables} as a message. I then selected Table 1

On Log in it returned 1 and 1

Matt

Changed the constraints I was using to {ENTITY NAME:Tables} Not Matches 1 and its worked…

let me see if is null works…

Matt

So first of all, either the plural or non-plural version both work, which is expected. But it has been mentioned previously to prefer the plural version since it is theoretically faster. Use {ENTITY NAME:Tables} whenever possible.

Since your Table Names are in your case simply numeric, you could use this:

[=TN(’{ENTITY NAME:Tables}’)] Greater 0

You could also use, as @RickH mentioned, this:

{ENTITY NAME:Tables} Matches 1|2|3|4|5|6|7|8|9

The overall Rule should be set to Execute when Matches or Matches All

I still don’t understand this. Your Rule has 3 Actions:

SU_Switch User button
Close Ticket
SU_Logout

It appears you have a Logout action in there as the 3rd action. If the 1st action is also a Logout action, then you need to place it after the Close Ticket action.

Maybe post a revised screenshot with your actions expanded. Also post screenshots of all the individual Action definitions being used in the Rule.

It was a mistake on my side, I had confused myself by not adding log out to the action so created a second rule.

1 of them has now been removed.

Guys, really appreciate the help.

The above works. Thanks so much for your help.

@QMcKay could you tell me what [TN= means, and what it does?

Thanks

Matt

I am basing my responses on this screenshot. Tell me what you want or expect this Rule to do?

If the Ticket Tag for AUTOPRINT is not Bar Tab, then I assume it is blank. Is that the case?

If the above is true (the Ticket has no Tags), then you must ensure the Ticket has an Entity Assigned before you can attempt to close it. In which case, you want {ENTITY NAME:Tables} to be Not Null, greater than zero, or matches a Table Number.

Has been updated already :slight_smile:
I just wanted the logout button disabled when a bar tab was selected so only the bar tab close button works.

Matt

[=TN()] converts a string to a number, and also ensures it is a valid number.

If the string is numeric, it converts it to that number.

If the string is non-numeric, then it results in 0.

So if the string is blank/empty/null, or *, or Blah13, then you get as a result 0

And if the string is 1 or 2 or 3 etc, then you get as a result 1 or 2 or 3, respectively