[New 4.1.37] Ask Question Action

This feature was a missing piece in our automation system. Now you can ask questions to user and execute a command with selected command parameter. I’ll add more tutorials but I’ll show some brief examples.

For example you can ask if he wants to print a bill.

It executes Print Bill command by sending selected Button to Command Value parameter.

You can define values for buttons. For example that can be asked when discount button clicked.

When No discount button clicked it sends 0 value.

You can use it for anytime user needs to make a selection. For example you can ask this when a Breakfast item added.

…and assume Tea selected and it executes Add Free Order action.

8 Likes

Dear @emre, I have implemented this question action without problems, but I cannot figure out where the command value parameter is checked, so, even thoe i aske the question and the question is displayed, i cannot take actions depending on the optons…

Thanks!!!

G.

Create a Rule for Automation Command Button event, and in constraints add the value that you want the Rule to execute.

Thnaks John… implementing this without internet was a little bit difficult, but with your help i could…

THANKS!!!

G.

I’m trying to set this up for discount - but as usual my lack of knowledge is proving a challenge!

I have got the ‘ask question’ action - asking the question which is a good start! but I don’t appear to have the brains to make it work … It just keeps displaying when I click on it and then I have to crash out !

Some Screen Shots!
As well as the Ask Question action I have a ‘Discount’ action - pictured below

The Calculation Type is configured as below

and the rule is as below

as always all help greatly appreciated! this is an added feature and not life threatening - so when you have time that would be great :slight_smile:

In your Discount Action, change the Amount field to [:Amount].

In your Rule, remove the Ask Discount Action altogether.

In your Rule, remove the Discount Action, and then re-add the Discount Action (this will update it’s parameters within the Rule).

In your Rule, within the Discount Action, where you are using [:CommandValue], replace it with something like [?DiscountAmount:\d+\.?\d{0,2}].

The leading question mark (?) notation should prompt you for a value, asking for DiscountAmount, while the expression that follows limits input to numbers with 2 decimals.

1 Like

@QMcKay thanks for the response - I was wanting to use the ‘Ask Question’ action with the values pre-defined as they are in Emre’s screen shot above.

Ok, I see… yes, it keeps Asking the same Question (looping).

I’m not sure how to handle this feature… Let me look into it and get back to you…

I got it to work… took me a little while to wrap my head around the looping issue - that is, why the loop was occurring, but I get it now and it works! :smile:

The loop occurs because the Question Action fires the Automation Command, and the Rule captures the Automation Command event, and then calls the Question Action, which fires the Automation Command, and the Rule captures the Autom…etc. etc. Yeesh!

So you actually need 2 Commands and 2 Rules, so you can Ask the question, then Apply the result…

NOTE: this example uses a FIXED discount amount rather than a PERCENT discount, but the same theories apply to either type of Discount.

I have 2 Automation Commands, and 2 Rules: one to Ask the question and one to Apply the discount.

The Discount Action:

The Automation Command (button) we use to Ask how much:

The Automation Command we use to Apply how much (no mapping to Visibility):

The Ask Question Action:

Rule to capture the click-event of the Automation Command that we use to Ask the question:

Rule to capture the Automation Command that we set in the Ask Action, to Apply the discount:

It is actually a very powerful feature! :wink:

Of course, you don’t need to have an Automation Command (button) to Ask the question; instead you could capture a different Event, such as @gerlandog is doing in his Tutorial below…

hopefully this helps out… after a lot of tria and error I got it working…
it simple once you picture it…

rule has a question, question fires an automation command, add a rule to handle the automation command…



THANKS!!!

G.

PS, if there is a simplier method, I reaaaaaaally would like to see it, since I spend like 6 days figuring this out, jajajjajajajajajajajaja!!! Thanks @Emre and @JohnS!!!

G.

@QMcKay getting there now …Just trying to figure out how to express the discount calculation which should be something like
{Ticket Total} - ({Ticket Total}*[:CommandValue]/100 ) but I don’t know the syntax I should use to apply that calculation … at least the Ask Question has stopped looping now QMcKay, good work! and now it makes sense.

I am trying to apply the discount from the settle screen on the whole ticket. just realised that the value returned from the ‘ask question’ SHOULD populate in the discount action and then apply to the discount calculation type… but is refusing to work! think I need a beer and then it will work :smile:

Strangely enough, I can’t get this to work on the Payment screen, but it does work on the Ticket screen…

This is the value supplied to the Message Box:

T:[=TN('{TICKET TOTAL}')] P:[:CommandValue] A:[=TN('{TICKET TOTAL}')-TN('{TICKET TOTAL}')*[:CommandValue]/100]

Which is different than the value Supplied to the Discount Action:

[:CommandValue]

So here, showing the Rule, and the workflow, that appears to work on the Ticket screen only:

your doing well @QMcKay I cant get the discount to apply no matter how I try - must be something in my ‘calculation type’ I think - I will try again tomorrow… getting late here and early start!

@emre @JohnS Hi - there are a couple of us having difficulty setting up the ‘Discount’ example above. I would like to add a discount button to the payment screen that discounts the Ticket Total but this doesn’t appear to work… I’m sure it must be something easy but need some guidance as ever. Thanks

Discounts on the Payment screen are controlled via Calculation Selectors. The Update Ticket Calculation Action does not work on the Payment screen.

But wait - there’s more :smiley:

If you add Display Payment Screen Action to your Rule to set the discount, then it works.

Cheers @JohnS - When creating rules do we treat the Calculation Selectors in the same way as an auto command ?

eg: Automation Command equals Discount ( Discount being the name of the Calculation Selector in my case )

Ok, that was a little easier than expected.

Discount Calculation Type - No calculation selector required for this.

Action to update Discount

Action to Display Payment screen

Automation Command to apply Discount - No mappings needed

Action to Ask for Discount

Automation Command to Ask for Discount - Mapped to Payment Screen

Rule to Apply Discount from Ask for Discount Action. We need Display Payment Screen action to refresh the Payment screen.

Rule to Ask for Discount

It may be hard to understand because we are using two Automation Commands here

Automation Command -> Rule -> Ask Action -> Automation Command -> Rule -> Final Actions
1 Like

Followed this - checked it at least 100 times and still the damn thing won’t do as it’s told! If I map the Calculation Selector and manually discount it works - if I use the Ask Question - nothing happens! I have tried mapping ‘Apply Discount’ to Ticket and still nothing happens! Baffled

ignore that! I’ve fixed it - I was trying to discount an item that I had tried to discount before when it didn’t work - and it didn’t like that ticket!! created a new one and all is working - that’s another Beer I owe you @JohnS I hope I never visit Oz as it will cost me a fortune in pay backs :slight_smile: as ever I bow down to your Genius!!!

@windinghouse, Calculator Selectors turns on buttons for us to use or allows automatic use (like auto rounding)
When we use rules to manipulate these calculations, we are actually working with the calculation itself (calculation type) and not the Selector.