FortiSOAR Discussions
ranjeet
New Contributor III

Unable to Update Image in DOCX File Using "FortiSOAR MS Word Report Templating" Integration

Dear Community,
I am trying to update an image in a DOCX file using the "FortiSOAR MS Word Report Templating" integration, but I am unable to update the image. I have attached the playbook and a reference link for your review.

 

Use Case:

I need to take a manual input of an image from an analyst and update the image in the DOCX file as evidence, then send this file to the relevant recipients. To meet this requirement, I created a sample DOCX file and attached it in FortiSOAR attachment module. Then developed a playbook that finds the attachment using the "Find Record" action, retrieves the image input from the analyst, and creates this image in the /temp/ directory using Python code. After creating the image, we update it in the DOCX file using the "FortiSOAR MS Word Report Templating" integration, then we sent the email to the relevant recipient and deleted the image from /tmp/.

Reference link: https://docxtpl.readthedocs.io/en/latest/ 

 

If anyone has a solution to this problem, please let me know.

Thanks.

2 REPLIES 2
tkanade
Staff
Staff

 

The function InlineImage is required and when passed via playbook it becomes a string and not a callable function 

Connector also does not have import call for  InlineImage from  docxtpl

 

{"logo": InlineImage(doc, "tmplogo.png")}


In short, we need to edit connector so to take image parameter separately, may be just file path. Let me try and get back to you. Or you can connect with me directly over email 

okumbhar
Staff
Staff

To support this requirement we are adding a new parameter 'Context Images' in the 'Generate Report' action. We will release this change in upcoming connector version.