Home > Forum > Actions > Add attachment from current instance to another workflow

Add attachment from current instance to another workflow
0

Hi,

If I am reading documentation correctly action Add attachment allows copy/move attachment from another workflow to current instance. My case is opposite:

1. I have an invoice approval workflow which in the end requires (business requirement) adding payment confirmation (PDF) from banking systems. Manual process is very time consuming.
2. Each payment confirmation has in transfer's description instance signature from the invoice workflow.
3. I've created another workflow, which is monitoring hotfolder for new payment confirmations and then after adding text layer and OCR AI steps (finding signature of invoice instance) keeping the signature value in the text field.
4. Now I want to copy attachment from the workflow from point 3 to the invoice workflow from point 1 using signature (and then WFD_ID) as a key.

Is it even possible or I should rather take another approach: Invoice workflow will have a systems step with cyclical actions monitoring workflow from point 3 and then if an instance with the same signature field value appears will add attachment to itself and move to the next step?

In reply to: Przemysław Wrzesiński

Thanks. For now I used first approach mentioned by Karol but I look into ito using API as more elegant solution I suppose.

I tried your approach according to your blog post, but I have a problem to find attachment ID. Will it be correct approach that before using new global automation I create local parameter using Get Attachment function and pass it as an input parameter as AttachmentID?

MVP
In reply to: Przemysław Wrzesiński

I tried your approach according to your blog post, but I have a problem to find attachment ID. Will it be correct approach that before using new global automation I create local parameter using Get Attachment function and pass it as an input parameter as AttachmentID?

Hi Przemysław,

you using the function would be one option. Other are:
- Set the local parameter using an SQL command
- Use the for each function to iterate through the attachments
- Use the for each function in combination with a data source
- Use the for each function in combination with "any collection

Since there are numerous ways where the attachment id could come from, I didn't explicitly define it.

Best regards,
Daniel