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.
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…
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
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.
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!
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!
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…
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!!!
@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
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
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 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.