I work with CLM and develop workflow for our clients. A lot of them say that they want an attachment field in the docgen form, and I have used it so far. The problem is: - When using an eForms, its always easy to find an attachment using the step Find Attachments, but with the docgen form, this step doesn't seem to work.
In the related documents field when you open the document generated, there are no attachs. Does anyone know why? What can I do to automatically attach the documents?
Thanks
Best answer by Pawan Gangwani
Hello â@Matheus CardosoÂ
Welcome to the DocuSign Community!
When you're using an Attachment field in a DocGen form, the attached document will be stored within the workflow variable called params (as shown in the screenshot Iâve included).
Now, to retrieve and work with the attached document inside the workflow, you can use the "Evaluate XPath" step. This will allow you to locate the attached document within the params structure just like I typically do in similar use cases. Â
Once you've found the attached document's ID and the submission document's ID, you can then combine them using a C# script step (also illustrated in the screenshot Iâve shared). This enables you to treat the attachment as part of the generated document and handle it seamlessly in the rest of your workflow.
Let me know if youâd like a sample XPath or C# snippet for this happy to help!
When you're using an Attachment field in a DocGen form, the attached document will be stored within the workflow variable called params (as shown in the screenshot Iâve included).
Now, to retrieve and work with the attached document inside the workflow, you can use the "Evaluate XPath" step. This will allow you to locate the attached document within the params structure just like I typically do in similar use cases. Â
Once you've found the attached document's ID and the submission document's ID, you can then combine them using a C# script step (also illustrated in the screenshot Iâve shared). This enables you to treat the attachment as part of the generated document and handle it seamlessly in the rest of your workflow.
Let me know if youâd like a sample XPath or C# snippet for this happy to help!
â@Matheus Cardoso Sure, we can share that with you, here you go! you have to save the attachment in the âAttachment_Idsâ test variable first then you can go.
To Combine them Here:Â Â
var a = GetVariableValue("Submission_Document_Id");Â var b =GetVariableValue("Attachment_Ids"); if (b != "") { Â b = "|"+b;Â }
Hello, â@Pawan Gangwani! I have a similar question. Instead of combining them, I'd like to know if there's a way to automatically attach this document to the one being generated â just like I would manually do it through the âRelated Documentsâ section. Since there's a step that can automatically add a reminder, I was hoping the same could be done for attachments.Â
Yes, absolutely â to automatically attach a document to the generated one (as it appears in the âRelated Documentsâ section), you can set this up using attributes and workflow variables.
Hereâs how you can do it:
Create an Attribute Group and an Attribute within it named âRelated Documentsâ.
In your workflow, when you get the attachment (like from a form or another step), store the attachment's Document ID in a variable.
Then, use the Update Attribute step to set the âRelated Documentsâ attribute with the value of that variable.
This way, the attachment will automatically be linked.
â@Pawan Gangwani Thanks for getting back to me! I think I might be doing something wrong â I'm not getting the expected result. Instead, the attribute is being updated with the document's UID, as shown in the image. Could you clarify what types of attribute and variable I should be using? I tried setting the attribute type as "string", and used both "document" and "text" as variable types, but neither worked. Thanks!
Yeah, I got that! Please stick to the string type for the attribute that's correct. Now, do one more thing: in the attribute settings, check the âRelateâ option. Thatâs key here.
Once you enable "Relate" for that string attribute, it should properly resolve to the related document's field (like its name or title), instead of just showing the UID.
Give that a try and re-test. It should behave as expected now.
Thanks again â@Pawan Gangwani Unfortunately, that didnât work. What exactly should I relate this attribute field to? Its own attribute group? That seems to be the only option available.
Thanks again â@Pawan Gangwani Unfortunately, that didnât work. What exactly should I relate this attribute field to? Its own attribute group? That seems to be the only option available.
Yes that true, âIts own attribute groupâ and do not create any other attribute in that.
Thatâs a bummer, it didnât work as expected.Â
Hello â@rodvillaniÂ
I tested on my Dev account, and it worked. Can you tell me which âDocumentâ you are selecting in âUpdate Document Metadataâ step. For information you need to select âDocument_Idsâ to make it related. I have explained it above to combine both in âDocument Idâ and use this. It will work 100%. Â
You can login or register as either a Docusign customer or developer. If you donât already have a Docusign customer or developer account, you can create one for free when registering.
You can login or register as either a Docusign customer or developer. If you donât already have a Docusign customer or developer account, you can create one for free when registering.