Kaseya Community

ExecuteSqlQuery to variable in Ticket Mapping Procedure

  • Is this possible?

    The IF step is available and I can add my SQL query to the procedure and declare the output variable but then I don't seem to be able to call on the variable to use it in the procedure no matter how I format it. I have tried variablename, #variablename#, [=variablename=] and [$variablename$] all with no joy.

    The query work exactly as expected in SMSS and produces a single result as a string of text

  • We used to use:

    ExecuteSqlQuery("SqlCmdId", "RVal", "Continue on Fail")

    If checkVariable("#RVal#") Equals "1"

     do stuff...

    This worked just fine. Our original ticket intake procedure was 560 lines of code and comments and filled with these type of commands. Note that the If test in this module defaults to string compares, which drove me nuts initially as it was saying that 4 > 10. It is, if you compare as strings char by char! That's why we wrote the Multi-Tool for Service Desk - 60 commands that do precision math or string (defaulting to REAL numbers if both values are numeric) comparisons, logic, string manipulation, time/date manipulation, and more.

    If you're having issues, review your XML authorization files for correct syntax.There's a lot of moving parts here, and you need to do a LOT of processing in the Intake procedure, By comparison, our stage process procedures were just 30-60 lines of code. There's also limitations in the SAAS product that prevent things like SQL commands.

    We moved all processing to back-end logic and our intake procedure does much more now in just 18 lines of procedure code. Take a look at the RMM Suite and the Multi-Tool on the Automation Exchange or our web site (www.mspbuilder.com) to see what we've done with Service Desk. The Multi-Tool is a great way to "roll your own" apps with advanced functionality for just $300.

    Glenn

  • Can you post the actual line from the XML file stored in C:\kaseya\XML\SDProcSQL\0\SQLQuery

    This way we can see what variables etc you are using in the actual query string