Integration - Referencing Input from previous automation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Integration - Referencing Input from previous automation

L1 Bithead

Hey there. I have what I believe to be a python syntax question. We have a playbook with two automations. The first downloads a file, which is successful. The first automation has an output of the EntryID.

 

The second automation needs to use the entryID to get the file that was just downloaded it and perform some tasks.

 

Finally the question; What is the syntax in the second automation to reference the input entryID?

 

 

In powershell it looks like: $entryId= $demisto.Args()["EntryId"]

 

What is the python equivalent?

 

The goal of the second automation is retrieve the downloaded csv, parse it and then insert data into the database.

 

We’ve tried:

params=demisto.params() - error: params doesn't exist

args=demisto.args() - error: args doesn't exist

demisto.params()["EntryId"] - error: params doesn't exist

result = demisto.ExecuteCommand('getFilePath', @{id = entryId})[0]["Contents"]["path"] - i cant get to the entry id

 

 

We’ve reviewed:

https://xsoar.pan.dev/docs/integrations/code-conventions

https://xsoar.pan.dev/docs/reference/api/common-server-python

System scripts for examples

 

Our Playbook:

Automation 1 Inputs

Tripper_0-1651263192113.png

 

 

Outputs

Tripper_1-1651263192116.png

 

 

Automation 2

Input

Tripper_2-1651263192118.png

 

 

 

1 accepted solution

Accepted Solutions

L1 Bithead

figured out what i was missing. obviously I am new to demisto/xsoar.

 

I had outputs and inputs/attributes listed. the piece i was missing was mapping the inputs to outputs in the pervious step.

Tripper_0-1651504432543.png

 

View solution in original post

4 REPLIES 4

L2 Linker

 

Screen Shot 2022-04-29 at 3.22.43 PM.png

to reference an input in python, you would use demisto.args().get('EntryId'). Job_softwaredate_Update_Trip need to have an argument called 'EntryId' on it.

L1 Bithead

totally appreciate the response C. I think i was confused between inputs and attributes. Once i added the argument, i now see the default value. So making progress.

 

Since I am seeing the default value for the argument instead of the value that was returned by the previous automation, i'm either not referencing the right var or it isn't set up to be returned to the next autimation.

 

The output on the previous automation has an output - 

Tripper_0-1651496799563.png

Do I need to have the file as part of the reference?

L1 Bithead

something i just noticed is in the warroom message for the download step, EntryID isn't in the list of outputs

Tripper_1-1651497157879.png

It is in the output list for the download step just like the rest that are being displayed above step. However i can't reference any of the file attributes - demisto.results(demisto.args().get('size'))
demisto.results(demisto.args().get('Type'))
demisto.results(demisto.args())

 

The only value in args is the default value i set for the attribute. So the values/outputs from the download step, are not being passed to the next step. Not sure what I am doing wrong or the thing to post to help you to help me . . . 

L1 Bithead

figured out what i was missing. obviously I am new to demisto/xsoar.

 

I had outputs and inputs/attributes listed. the piece i was missing was mapping the inputs to outputs in the pervious step.

Tripper_0-1651504432543.png

 

  • 1 accepted solution
  • 3022 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!