- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Enhanced Security Measures in Place: To ensure a safer experience, we’ve implemented additional, temporary security measures for all users.
08-03-2021 08:59 AM
I have a custom integration where I am trying to map results (in strings) that are emails
into output to use for the next defined task or playbook.
I figured, IF the output looked like
output = 'email1\nemail2\nemail3'
that I could do a return_results(output)
and then in the Script settings, map the 'outputs' section under Arguments to "context path" ScriptName.output"
and then the data would appear?
what am I doing wrong? How do I return the results from one command to use it elsewhere?
08-03-2021 12:58 PM
You first want to call CommandResults to build the result you want to pass to return_results:
https://xsoar.pan.dev/docs/integrations/code-conventions#commandresults
Example:
emails = "email1,email2,email3"
output = emails.split(",")
result = CommandResults(
outputs_prefix="MyCustomEmails",
outputs=output,
readable_output=tableToMarkdown("My Custom Emails", output, headers=["Emails"]))
return_results(result)
Your outputs in the automation would by defined as "MyCustomEmails"
You can reference the CommandResults in the Script Helper as well.
08-03-2021 12:58 PM
You first want to call CommandResults to build the result you want to pass to return_results:
https://xsoar.pan.dev/docs/integrations/code-conventions#commandresults
Example:
emails = "email1,email2,email3"
output = emails.split(",")
result = CommandResults(
outputs_prefix="MyCustomEmails",
outputs=output,
readable_output=tableToMarkdown("My Custom Emails", output, headers=["Emails"]))
return_results(result)
Your outputs in the automation would by defined as "MyCustomEmails"
You can reference the CommandResults in the Script Helper as well.
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!