Knowing how many times a specific button has been pressed

I’m not sure if this was possible in v4, but It could seem possible in v5. Is there a way to also track the number of times a non menu item button has been pressed?

For example, when creating a button to open cash draw, a client would like to know how many times the open cash draw has been open throughout the work period and by whom specifically has it been open by each time and at what times. My guess is that all of this could be possible through custom reporting, however not quite sure on how to make an action or rule that could track the amount of times a button like that is pressed and have a report to show it at end of work period. Any thoughts or suggestions?

Think it would have been doable in V4 but either way there was a nice discussion on something very similar (may have been void - but same principle)
They aded an ask question before voiding which gave options for reasons and then the time, user and reason were ‘printed’ to a text file/log.
Am trying to find it but struggling.

Was it this tutorial? Configuring Gift & Void Reasons

Sorry, isnt like a printer, there is an action of add line to text file.
Set file path to your .txt log and format the log in the text field.

Something like;
{DATE} - {TIME} - {:CURRENTUSER}

Then add that action to the rule for automation command executed for No Sale or whatever your using for open drawer.

If you wanted to expand on that you could use as said above an ask question or automation command values of button to select the reason and add the command value to the end of the line.

Please note I haven’t done this myself so the {tags} might need to be adjusted, am never sure when to use {USER NAME} and {:CURRENT USER}, this it should be {:CURRENTUSER} as believe {USER NAME} is a ticket specific value and as no sale can most likely be exacuted before ticket created the current user tag would be needed.
In fact looking at some of my other rules it might actually be [:UserName].
Am not at PC at the minute so cant test, sorry.

Haha that’s ok JTRTech. Thank you for that, I’ll see how I can incorporate that with the open cash draw tutorial and see how I can attach it to the reports. I know when pressing gift and adding a reason(after configuring it) it auto adds the gift to report, so there may be a way it would do the same thing even for a button like open cash draw as well. I’ll keep you informed how I go.

Gift button changes the state of the order and believe that is why that gets picked up in the default work period report which is looking for (among others) the gift state.
The above method would give you a text file log for a start.
Am yet to do much work with custom reports so cant help with that im afraid.

Hmmm. I wonder whether than we could create a button, have it work like an order state change, and have the number increment up by 1 each time it’s pressed to calculate total amount of times its been pressed during the work period?

If its just a value of the number of times and not a log there are simpler ways.
Could use a program setting value.
Should be easily enough to call the value in the report then set additional rule&action to reset to 0 at work period end.
If I were to do it and wanted a count on report I would probably have the log in the background aswell so if something looks odd you can check the log file and see who opened the drawer so many times.
Personally would add the reason prompt also.

Hmm. Alright, I’ll try that method, could you show me using screenshots how this can be done whenever you get a chance?

Action: Update setting (local setting:false)

Rules:
Update setting:
Values: [={SETTING:Settingname}+1]

it is in a few words where to look …
if you need to later write detailed instructions

though perhaps I am wrong
Emre or QMcKay can disprove my idea

oops, sorry.
I dont see
JTRTech wrote about it

Wouldnt even need that, there is an update type option which you should be able to set to increase and set value to 1 :smile:

option 1 - trigger - evry day: update setting (value = 0)

option 2 - custom “workperiod start/end” button

hmm… i dont read all terms

If these conditions are important can be done with “Entity State”

such records made @QMcKay and @Jesse for TimeClock

Use Update Program Setting action set it to update. Use the Automation Command Executed rule that you use for your button. If you want to clear it then use another of same action but set it to delete and trigger it on WP end event.

I will give you an example in a minute…

The Action

The rule for your button

The rule for clearing the count on WP end

Now if you want a permanent log of this so you can look in past at previous dates etc. There is a more advanced way to do this it involves a new action added recently called Add Task. I have not attempted it yet but I could see how it might work great for this.

There is little documentation for Add Task action it was literally added the day before launch. We will be adding more documentation soon.

2 Likes

Once the WP has ended though, would it keep the record on the report? to at least show that it was pressed by the employee who was logged in at that time? @kendash

The program setting count would be a daily tally given the delete action on wp-end.
You could put a date tag in the setting name but would leave you with setting per day so lots of entries after years.

As I said if I were doing what you are looking to do I would use program setting to keep tally for the day which prints on the report and keep a text log of each open draw with date and time with user in the text file to go back to.
You could have a summary add text to file before the reset action on wp-end which puts in a separated between days with a total count for records.
If going to all that effeort I would have said it would be just as we’ll to add the reason prompt and value into the log.

@JTRTech I think ideally it would be right to do so, and txt logs don’t take up much room. Could you specify where it saves the txt log?

You choose the directory/file, there is probably some permission based restrictions, like with backup location.

Alright cool. I believe I can use Kendash’s tutorial to set it up. Is it similar to how you would set it up or different?