Skip to main content

Search

Search

Reading A Trigger File, Using Data For Excel Record Lookup (Bt 2016)

Comments

5 comments

  • Avatar
    Legacy Poster

    I have been working with it a little more, and think I almost have it:

     

    1) Integration builder detects the file

    2) integration builder reads a text file containing a text string

    3) integration builder loads variable %EventData% with that text string

    3a) integration builder then writes that string into another text file so I can verify it is being read properly

     

    --

     

    4) BarTender label database setup - I added a filter called "AND Part# Contains ?QueryPrompt1"

     

    When I manually select "Print" and "Print Preview", I can enter the same string that appears in %EventData% (in step 3) and I get the record that I want, formatted, and printed.

     

    --

     

    5) Integration Builder - I set up action Print Document, check "Specify Values for Query Prompts" then set Name = QueryPrompt1" and Value = "%EventData%"

     

    I am expecting the BT document to query for a part number, then Integration Builder to fill that query and print.

     

    What I get is "BarTender: Error Message #3...  No records found."

     

    -

     

    Is this the proper way to pass a variable from Integration Builder into a BT document?  It appears that the query is being executed, but I can't figure out why the record is not found.

    0
  • Avatar
    Ian Cummings
    Moderator

    When the event message is detected then the content of the message is automatically written to the %EventData% integration variable.

     

    When you do a print job in BT manually, supplying the same query prompt data, does it find any records?

     

    Why use the "contains" operator in the filter and not equals?

     

    As a test, put a literal value in the Integration for the query, to see if that still returns a record.  If not then something else might be going wrong.  Perhaps the action needs to execute under a user account or something.

    0
  • Avatar
    Legacy Poster

    Thanks for the tips.

     

    I eventually got it to work and I'm not exactly sure what happened.  I know I was getting the Integrator to interfere with the BT document.  Some of the print settings I had in the Integrator were over-ruling the settings inside the BT document.

     

    There was something else that was happening, too.  I was reading the trigger file, the string was being put into %EventData%, and then being passed into "QueryPrompt1" the way it's supposed to work.  Somehow, I had gotten the system into the mode where it would not find a matching record if I had the filter set to "equals".  If I had the filter set to "contains" then it would work.  I don't know how it happened, but apparently the string field I was reading from an XLSX file contained trailing spaces after the part number (this is just my guess).  When I passed the part number in QueryPrompt it would fail to find a match if I was filtering on "equals".  So I had to use "contains", but that led to other problems.  If the %EventData% read an empty trigger file, it would pass along an empty QueryPrompt that would cause it to print either the first record or all records depending on other settings.

     

    I don't know what I did to fix this, mostly trial and error, but it is now working the way I wanted it to work.

     

    The interesting thing is, even though it is working now, I can still recreate the behavior.

     

    If I go into the filter and set it to "equals", then Apply Filter, I can type in a part number and no records will be found.  If I change the filter to "contains", then "Apply Filter", and type in the same part number the correct record will be found.

     

    But, if I go into "Record Browser", the "equals" filter works properly.

     

    I don't understand the difference in behavior between "Apply Filter" and "Record Browser" and why one returns a record using "contains" and "equal", and one returns a record only with "contains".

    0
  • Avatar
    Ian Cummings
    Moderator

    I would imagine this is to do with data types, which is why the use of Excel as a database should be avoided if possible.  When using equals the data type would need to match and not just the characters. When doing a contains comparison, I guess this implies a string data type which is why you get a match.  We have a knowledge base article on the website detailing the perils of Excel.

     

    https://support.seagullscientific.com/hc/en-us/articles/217162148-Troubleshooting-Excel-and-BarTender

    0
  • Avatar
    Legacy Poster

    Just heard from BarTender tech support.  They recommend downloading R2 (just released) that has a bug-fix for the problem I was having.

    0

Please sign in to leave a comment.