Cancel button on portion selection that deletes last item

I have a rule set to have a portion selection automatically pop up,

I have added a cancel button to it but even if the selection window closes, the item still remains on the ticket.

How can I remove the last item? I already tried adding a custom action to remove last item for that but it won’t trigger on my setup.

Thanks

You want a cancel order action with last order true and constraint for value = cancel.

I added the Cancel Last Order Action to the rule and added Constraint like this, but it still doesn’t delete last item when I click Cancel.

Your update order action wont either, both need to be in an automation command rule, that is what the command value is passed to.
Also your command name wouldnt be none, it would be something like 'ask portion command.
Then in that rule the update portion and cancel actions will be.

So I need to create an ‘Ask Portion’ rule separately with ‘ask portion command’ as the Command Name then another rule for ‘Update Portion’ that includes Update Order and ‘Cancel Last Order’ action and only the Cancel last order should have constraint ‘[:CommandValue]’ == ‘Cancel’ . What should I put as Event Name and custom constraint for this last rule with both Update and cancel? I’m confused on how the workflow is.

No. You can use command name and value from ask question action your using but you put none as command name and no command value so it’s not going to work.

Your ask question stays where it is.
In the action where you put command name ‘none’ change that to something meaningful.
Then in a new rule with event automation command executed put that same command name as constraint on rule.
The ask question action triggers automation command and passes the command value - in your case portion or cancel to that rule.
Then in that rule put the update portion and cancel actions with those constraints on the actions.
The command value will then either trigger the update portion via the value not being cancel and the value being used to update the portion or if cancel it triggers the seccond cancel action.

1 Like

It should work within the same rule but he never defined a command value.

You sure. Though action constraints were evaluated at rule event meaning there would be no command value either way since ask question not been answered?
Buttons would be the command value no?

Oh your right I was thinking he used a different action sorry.

Edit: I have set up as follows and it works perfectly! The portion selection works but when I click Cancel the item gets deleted. The cancel action had to be the “Cancel Last Order” action I created, I picked the wrong action! Thanks a lot! :slight_smile:

image

I’m not familiar with the last but in buttons after cancel. What’s the red red bit for?

Does it work if you don’t hit cancel?

{PORTION BUTTONS},Cancel=Cancel:red;red

First color is button color second color name is hover color I still don’t know how to use hex colors here as it seems to break the selection box.

It is working now I selected the wrong cancel order action, that’s why. I edited the original reply

I’m asking if you don’t hit cancel it adds order correctly? I thought it should work I just wanted to be sure.

If I don’t hit Cancel and select a portion, it would add the item and the selected portion.

1 Like

i have Problem With When I Select Cancel Button Still Select Automatically 1 portion,Pls guide me tq