Skip to main content

Hello everyone

I hope you are well

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

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!

Thanks!

👪 DocuSign Community Leaderboard Top 5 contributor
💹 Ranked #3 in the Reply Royalty category in DocuSign Community Wrapped 2024
🤝Let’s LinkedIn and rollPawan Gangwani - EY | LinkedIn


Thank You Pawan

 

This C# Script Step works like the Combine Document Step?

If not can you share the script? I didn't find it

Thanks

Matheus


@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; 
}

return a+b; 

Thanks! LMK if you need any help.

👪 DocuSign Community Leaderboard Top 5 contributor
💹 Ranked #3 in the Reply Royalty category in DocuSign Community Wrapped 2024
🤝Let’s LinkedIn and rollPawan Gangwani - EY | LinkedIn


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. 

 


Hey ​@rodvillani 

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:

  1. Create an Attribute Group and an Attribute within it named “Related Documents”.

  2. In your workflow, when you get the attachment (like from a form or another step), store the attachment's Document ID in a variable.

  3. 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.

Thanks!

👪 DocuSign Community Leaderboard Top 5 contributor
💹 Ranked #3 in the Reply Royalty category in DocuSign Community Wrapped 2024
🤝Let’s LinkedIn and rollPawan Gangwani - EY | LinkedIn

 


@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!

 


Hey ​@rodvillani 
 

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!

👪 DocuSign Community Leaderboard Top 5 contributor
💹 Ranked #3 in the Reply Royalty category in DocuSign Community Wrapped 2024
🤝Let’s LinkedIn and rollPawan Gangwani - EY | LinkedIn


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.

Thanks!

👪 DocuSign Community Leaderboard Top 5 contributor
💹 Ranked #3 in the Reply Royalty category in DocuSign Community Wrapped 2024
🤝Let’s LinkedIn and rollPawan Gangwani - EY | LinkedIn


That’s a bummer, it didn’t work as expected. 


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%.
 

Thanks!

👪 DocuSign Community Leaderboard Top 5 contributor
💹 Ranked #3 in the Reply Royalty category in DocuSign Community Wrapped 2024
🤝Let’s LinkedIn and rollPawan Gangwani - EY | LinkedIn


Reply