How to actually download "Download Documents of Envelope" activity?

I was able to connect my Docusign account in this activity called Download Documents of Envelope

When I select an envelope and run the activity, it just runs but doesn’t seem to be downloading anything. I created a variable in its output with “IResource” variable type, but don’t know how to actually download the said envelope.

If I search for the filename being downloaded, I notice that it’s finding this in the local temp folder, and if I rename it with PDF extension then open, it’s the actual file. How do I actually download this file to specific repository with the correct folderpath?

Guide on this please. Thanks!

Hi @earldantedumayag

For Each document In EnvelopeDocuments (EnvelopeDocuments should be a list of IResource)
→ Inside the loop, you can process each document as needed
→ For example, you can save it to a local file
File.WriteAllBytes("C:\Path\" + document.FileName, document.Data)

“EnvelopeDocuments” is a list containing the downloaded documents, and we use a loop to iterate through them. Inside the loop, we use File.WriteAllBytes to save each document to a local directory.

Hi @supriya117

Thanks for your quick revert, and really appreciate this!

Sorry I’m not well-versed with UiPath; may I ask what activity do I need to use for this one? Also, the variable type is just IResource, not list of IResource. Should I change the variable type? Thanks!

@earldantedumayag

then directly use assign activity to save the doc in local machine:
“EnvelopeDocument” of type “IResource”
File.WriteAllBytes("C:\Path\" + EnvelopeDocument.FileName, EnvelopeDocument.Data)

Heya! When I tried your suggestion, it’s showing me this data. Apologies for not following thru; I’m a bit noobish with this, but really appreciate your inputs. Thanks!

image

@earldantedumayag

First of all…it downlaod the file to local folder…

Try using irsvariable.FullName in log message which will give thw actual file location

Cheers

Thanks for your response! When I did this, it only provided the name of the downloaded file, which is:

Please Docusign: xxxx.pdf documentid=combined

How do I rename this as just Please Docusign: xxxx.pdf and save it in say C:\user\documents?

@earldantedumayag

Try to use this in log message

IrsVariable.ToLocalResource.LocalPath

Cheerd

Thanks! I can see the full path now. I guess I’ll just use a Copy File activity to copy this file and remove the documentid=combined portion?

Or do you have a more efficient suggestion, something like File.WriteAllBytes("C:\Path" + EnvelopeDocument.FileName, EnvelopeDocument.Data)? The Data isn’t in ToLocalResource though.