If Then control in item Action

Suggestions for new functionality in NiceLabel. Do you want some feature but can't find it in the NiceLabel software? Post your wish here. Note: This is not a support forum.

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
NickM
Newcomer
Posts: 3
Joined: Mon Jul 01, 2019 8:00 pm

If Then control in item Action

Post by NickM » Mon Jul 01, 2019 8:12 pm

It would be a great benefit if I could easily add an If statement in an item's "Action". I know I can do this by adding a VBScript to the action, but this seems like it would be so much easier and faster if I could add it under the "All Actions" dropdown without having to write scrip every time in the same way that I can add a "For Loop" in the dropdown.

NickM
Newcomer
Posts: 3
Joined: Mon Jul 01, 2019 8:00 pm

Re: If Then control in item Action

Post by NickM » Mon Jul 01, 2019 9:05 pm

An example where this would come in handy.
- User clicks a print button on the form.
- A message box pops up asking if the correct paper has been inserted (Yes/No response on the message box that sets variable)
- Action, If variable = Yes Then continue to the steps to print

User avatar
Mytch
NiceLabel Support
NiceLabel Support
Posts: 45
Joined: Fri Jul 13, 2018 10:26 pm
Location: Milwaukee, Wisconsin
Contact:

Re: If Then control in item Action

Post by Mytch » Mon Jul 01, 2019 10:26 pm

Nick,

Thanks for the suggestion.

Please note that is is possible to use a Condition to determine if an Action is executed or not. In the Action's Execution and Error Handling area, there is an option to have the Action Enabled only under certain conditions. This Condition uses the same scripting language that is configured in your Form Properties. See below for an example:
screenshot_20.jpg
screenshot_20.jpg (77.55 KiB) Viewed 207 times
In this case, when the variable "YesNo" is equal to "Yes", the Open Label (and sub-actions) will execute. If the value is anything else, then the Action will not execute. We understand this is not the exact request you have made, but the existing functionality should be usable in most scenarios.

Mytch

highfrost
Enthusiast
Posts: 13
Joined: Tue Aug 19, 2014 10:51 am

Re: If Then control in item Action

Post by highfrost » Mon Jul 15, 2019 5:08 pm

Just to add to what Mytch said,
the group option is perfect to make this readable and easy to maintain. Also you only need to put the conditions once.
See below an example how I use these as my if-statements.
Attachments
2019-07-15_17-03-03.jpg
2019-07-15_17-03-03.jpg (127.38 KiB) Viewed 137 times

Post Reply