When I print with the trigger above, I get a proper format with the static data from the ZPL code chunks but the variables themselves fail to appear. Instead, the variable names print on the label. See below:
Thanks for the detail here. Happy to help. Moving through my debugging steps:
The Zebra Printer Driver catches errors, but Zebra Printers do not. Is your Trigger throwing an error of some kind? Is this error shown in an in-app Message (“Error executing Trigger”)?
From what I can see with your previous print, it would look like you can successfully connect to the printer, and therefore should be instead getting an Error Executing Trigger.
This error means that Tulip is having trouble parsing your Expression into text. To test this easily, copy that Expression, make a button, and paste the Expression in a “Show Message” trigger on that button. Now, we just have to fix this expression until hammering that button shows the Z-code we want.
The four things I would check here:
The Expression has all its quotes and +'s in order - this looks to be true, because it says “Valid Expression” on the bottom in green.
All the Variables in the expression have a value - if you give an Expression anything that includes a null or empty variable, the entire Expression will become null. Be sure your input Variables actually have something in them at the time that this trigger is running - for example, by using the Debug view.
The DATETIMETOTEXT function you have there is parsing correctly - it looks like it, but again if that becomes null then the entire Expression is null. Test this by pasting that function over in a different Message.
If all else fails, it’s because everything here needs to be of type Text (i.e. a String), and some of these variables are other types (e.g. Number, Datetime, or etc.). I don’t think this is the case, as I think the + already forces everything to be a string, but I may be wrong here.
Thanks Kyle! This helps very much. I think I have it working now. I’m a little embarrassed to say that I failed to notice the “SAVE” button at the bottom of the expression editor which was why I couldn’t get the expression to load.
One further question though: I see that we can load in data from table records, app info and variables. Are there any provisions for loading in data to the expression editor from app completion data?
@Richard-SNN that’s smart on the Zebra Driver error catch - good pick.
@nelsonj good to hear you’ve got it up and running! On your note with completion data -
Completion data is pretty heavily protected, as our regulatory users often reference it as an immutable source of record. Unfortunately, that protection includes that it is inaccessible by apps/app triggers.
I believe this is an existing product request (and if not, I’ll make one), but for now do you have a specific datapoint in mind? Obviously, saving whatever you need to a table (or, dis-enabling the “Clear on Completion” setting on the variable in question) will make something accessible in the future.