How to change a .xlsx file in context data or upload new from python script

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

How to change a .xlsx file in context data or upload new from python script

L1 Bithead

Hi all, 

Could you help me with the following problem?

 

I have an incident with .xlsx file that I handle by pandas and openpyxl. After the file will be handled, I need to save it to the context data to upload it to IRP by IRP integration and process a ticket.

 

but I have a problem: when I save the .xlxs file by the method .save from openpyxl the file is not changed in the context data. 

 

Maybe someone faced this problem? What can I do? I tried to create a file by FileCreateAndUploadV2 from python, but it doesn't work.

 

I will be grateful if anyone can help.

1 accepted solution

Accepted Solutions

L1 Bithead

with open(excel_file, 'rb') as _file:
demisto.results(fileResult(new_file_name_xlsx_file, _file.read()))

View solution in original post

1 REPLY 1

L1 Bithead

with open(excel_file, 'rb') as _file:
demisto.results(fileResult(new_file_name_xlsx_file, _file.read()))

  • 1 accepted solution
  • 1324 Views
  • 1 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!