Home Orchestrator

Is there a way to grab and pass a result from a DB query to another Item along the runbook?

VikVik Member IT Monkey ✭

Hi Guys,

I'm trying to query our DB for some data and it should come with a result that is 1 or 0, I then want to pass this result to another Item on the same runbook. I can use Published Data on other Activity Items, but there is no Published Data on Database Items properties.

Is there a way to grab a result from a Query Database and pass it to another item, if a result is found? Forum wont allow me to paste/attach images here, sorry.

Many thanks in advance

Best Answer

  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Answer ✓

    The DB integration control passes the data results as "Full line as a string with fields separated by ';'


Answers

  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Answer ✓

    The DB integration control passes the data results as "Full line as a string with fields separated by ';'


  • VikVik Member IT Monkey ✭

    Thanks @Brian_Wiest I'll try that.

  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭

    Recommend to start playing around with the Runbook tester. You can throw simple tasks in the runbook test it and it will show you all the results so you can see what it passed to the next "task"


  • VikVik Member IT Monkey ✭

    Hi @Brian_Wiest , is the Published Data ""Full line as a string with fields separated by ';'" the whole code i need to add there, or just the result expected (in variable)?

    The idea is to query DB for a token number, the result back will be either 0,1 or 2. The result will then be used in Published Data to pass it to the next activity.

    Thanks for your help on this.

  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭

    If you use the runbook tester you will see the returned value. If the query returns a single row with a value of 0 or 1 or 2 then you can just pass that to the next activity where just subscribe "Full line as a string with fields separated by ';'. But note this treated as a string value not an int. 90% of my DB jobs are followed by a .net activity (powershell) where i manipulate the output into a value/format I need for the reminder of the runbook.

Sign In or Register to comment.