- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
05-19-2023 05:20 AM
Hello,
We'd like to use the command "msgraph-download-file" insde an automation, then use the FileID to import a csv and finally convert it to pandas. The problem we find is that the output of "msgraph-download-file" is completely different when it's is used inside an automation.
How can we get this file inside an automation?
05-19-2023 07:43 AM
How about just opening the file with the automation after the playbook downloads and returns it?
Pass in the entryid of the file to the automation, and just have the automation go open it?
entry_id = demisto.args().get('entry_id')
res = demisto.getFilePath(entry_id)
if not res:
return_error("No file with that entry id found")
file_path = res.get("path")
with open(file_path, 'rb') as f:
data = f.read()
# do something with the data.
05-19-2023 08:30 AM
Thanks for the response,
we'd like to all the process inside the automation, download the file, open it and finally convert it to pandas.
06-06-2023 07:34 AM
Thank you very much for answering,
the key is that we would like to be able to directly use the "msgraph-download-file" command inside the automation, without the need to create a playbook with a task using the function to set the "File" in the context.We'd like to use the direct output of:
demisto.executeCommand("msgraph-download-file" ,{vars})
07-05-2023 09:20 PM
The problem is that the direct output of msgraph-download-file is *not* a file, it's a war room entry which contains a reference to a file. Until that war room entry has been written and the file reference is usable, it's not possible to get the data contained in the file. The only way to do that is to have two separate tasks, which requires a playbook.
If you absolutely can't use a playbook for some reason, the only option I see is to modify the integration to add a variant of msgraph-download-file which does the required pandas processing before returning anything.
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!