Get Document Reference step
Use the Get Document Reference step to create a reusable reference to a SharePoint document. You can reuse a document reference throughout a workflow. You can, for example, use the Get Document Reference step in a workflow that needs to perform multiple tasks on a document, such as checking out, checking in, and moving it. It is more convenient to create a document reference first instead of searching for the document each time.
At runtime, the Get Document Reference step returns single or multiple documents from the SharePoint library. Use the Filter section on the step to configure conditions to return one or more documents from the library. If you don't configure a filter, all documents in the library are returned. To see how to add a filter, see How to configure a condition to filter documents.
Drag the Get Document Reference step from the SharePoint category, Favorites bar, or the Recent category onto the canvas.
Example of a Get Document Reference step in a workflow- From the Toolbox click the SharePoint category, the Document category and then drag the Get Document Reference step onto the canvas.
- Select the added step and click the expand / collapse toggle to expand the Configuration Panel. You can also double click the step to expand the panel.
- Select the Get Document Reference tab. Use this tab to configure the reference.
- From the Library section click the menu, select Browse and navigate to the location of the library.
- Select the library and document, click OK.
- Click the Add Filter link to add filters.
- Select a property from the menu. Select an operator to define the filter. Type values or create dynamic values by dragging Functions,
Fields,
SmartObjects and
Workflow-related items from the Context Browser into the fields.
- In the Filters section, click Add to add a property.
- To delete filter properties, select it and click the Trash bin.
- To create a reference click Create. Reuse this reference in the current step or from another step in your workflow.
- To edit the auto-generated reference title, click Edit.
- To locate the added reference, expand the Context Browser, select Fields and then expand the Reference section.
- With the step selected, select the Properties tab.
- Click the Errors tab.
Your changes are automatically saved.
The following table explains the options available on this tab:
Option | Explanation | How to Use |
---|---|---|
Library |
Use this to browse to the library containing the document. |
Click the menu and select Browse to browse to a specific one. |
Filters |
The filter allows you to specify parameters and filters to return data. Applying filters is optional. Use operators such as Equal, Not Equal, Starts With, Ends With, and Contains. Parameters are sometimes required - it depends on the SmartObject method selected. If the method has parameters, you probably need to provide values for those parameters to execute the method. At runtime, the Get Document Reference step returns single or multiple documents from the SharePoint library. Use the Filter section on the step to configure conditions to return one or more documents from the library. If you don't configure a filter, all documents in the library are returned. |
Click the Add Filter link to add filters. Select filter values from the drop-down menu. Click the operator button to select the operator. Click Add to add additional filter properties Type values or create dynamic values by dragging Functions, Fields, SmartObjects and Workflow-related items from the Context Browser into the fields. To delete properties, select them and click the Trash bin. |
Use Document Later | Use this option to create a reference to use from other steps within the workflow. |
Click the Create link to create a reference. Click the Edit link to edit the reference name. If you edited the reference name and want to reset it, click the Reset Name link. |
For more information about the different browse states and errors, see the Browse States topic.
For more information on how to use the breadcrumb bar, see the How to use the Breadcrumb topic.
For more information on how to use Smartfields see the Smartfield Composer topic. Added filters can be grouped together to form parameters. To group parameters, click the AND button.
The following table explains the options available on this tab:
Option | Explanation | How to Use |
---|---|---|
Title / Name | By default, each step on the canvas has a step title. You can change this title to suit your workflow logic and show it on the canvas by checking the Show Label box. | Enter a value into the Title/Name field. |
Reset link | Use the link to reset any changes to the title. | Click the Reset link to reset the Title/Name field to default value. |
Show Label | Allows you to see the step label on the canvas. The label shows the value of the title. | Check the check box to display step label on the canvas. |
Description | Allows you to add a detailed description for the step. | Enter a value into the Create New field. |
Notes | Allows you to add additional notes for the step. | Enter a value into the Notes field. |
Different types of exceptions can occur on a step, such as:
Type | Description |
---|---|
Known exceptions | Any SmartWizard or standard wizard that has Boolean options for handling known exceptions have these options displayed as check boxes in the Known exceptions section of the Exceptions tab. |
Unhandled exceptions | Any unknown runtime exceptions. |
The tab contains the following known exception:
Exception | Explanation | How to Use |
---|---|---|
Continue on error | On step execution and an error occurs, continue to the next step in the workflow. | Check the check box to continue the workflow. |
The tab contains the following unhandled exception:
Exception | Explanation | How to Use |
---|---|---|
Log Exception | Logs the exception to the error log. | Check the box to log the exception. |
At runtime, the Get Document Reference step returns single or multiple documents from the SharePoint library. Use the Filter section on the step to configure conditions to return one or more documents from the library. If you don't configure a filter, all documents in the library are returned.
Scenario
Your company uses a SharePoint document library to store legal documents. As part of the employee onboarding policy, a new employee signs a contract and receives the company's policy and procedures. The employee receives an email with the Contract as well as the Policy and Procedures attached. In this scenario, you need to specify a condition on the Get Document Reference step to make sure the correct documents from the library are attached to the email. To do this, you add a condition in the Filter section.
The Legal Documents library contains several legal documents. You only need to attach the Policy and Procedure and Employee Contract PDFs to the email.
In the Filter section, configure the filter by adding two conditions. One for the Employee Contract.pdf and one for the Policy and Procedures.pdf. This filter ensures that these are the only two documents attached to the email.
In the Use Document Later section click the Create link.
This creates the Legal Documents reference for you to use in the Send Email step.
To attached the documents to the email, configure the Send Email step and drag the Document property (located in the Legal Documents reference section) from the Context Browser into the Attachment section.
At runtime the employee receives an email with two attachments.
If you add a document to a referenced SharePoint library, it won't be included in the reference until you start a new instance of the workflow.