Document Management With SharePoint - Part 3
Written By: Knox Cameron -- 8/24/2011 --
(2389) comments --
Categories: Design, Document Management, Features, Integration with other products , Programming and Customizations, SharePoint 2010, SharePoint Foundation 2010, Workflow
< Prev -
- Next >
| Become a paid author
Voilą! The workflow has completed and filled in the city for the
selected client into the document properties. You could now reference that city
inside the document using Quick Parts as discussed earlier.
Let's also add a column to the library for the consultant working on the
document, and extend the same workflow to find the consultant's picture and add
it as another column in the library.
First, add a column to select the consultant for the document from the
SharePoint user list: column name Consultant, type Person or Group.
Now add a column for the picture, name ConsultantPicture, type Hyperlink or
Picture, Format URL as Picture.
Edit the properties of the document to select a consultant, but leave the
ConsultantPicture column empty.
We now need to edit the workflow we previously created. Go back to SPD where
the workflow is still open.
- If you closed SPD, re-open it, and open your site. Select Lists and
Libraries on the left, then select the library you are working with from the
list in the middle.
- You will then see a screen of information about the library, which
includes a list of the workflows attached to the library, as well as the
"Custom Actions" which includes the button we added to the ribbon to run the
- Select the workflow you want to edit from the workflows list, in this
case called "Button - Lookup City".
- You will then see a screen of information about the workflow. Select the
link Edit workflow under the Customization heading.
- Yes, you could have used the Workflows heading on the left when you
first opened the site to go straight to a list of workflows. However, you
can have multiple workflows in the site with the same name attached to
different lists, and you couldn't tell them apart in that view. Going via
the list ensures you get the right workflow!
In the workflow, again use the Actions drop-down to add an action Set Field
in Current Item. It doesn't matter if this new action goes above or below the
existing one. They can both be in the same workflow step. This time, select
ConsultantPicture as the field to be set.
Again, click on the value placeholder, then use the function button next to
it to open the lookup dialog. This time, select User Profiles as the Data source
and Picture as the field. (While you have the Field from source drop-down open,
note the other information that we can retrieve from user profiles as well!)
Again, we need to tell SharePoint how to pick which user profile to use by
matching against something in the current item. In this case, we need to match
the user profile account name to the login name of the user selected in the
consultant column for the current document.
Under Find the List Item, in the field drop down select Account Name (which
is the only option). Click the function button for Value. Select the Current
Item as Data source, Consultant as the field, and Return field as Login Name.
Select OK again.
Publish the revised workflow using the button in the ribbon. Then return to
SharePoint and use the Lookup City button to run the workflow again for the
document. (Later, you can use Custom Actions for the library in SharePoint
Designer to rename this button to something more appropriate!) This time the
workflow goes and gets the picture and adds it to the list as well.
< Prev -
- Next >
- Think about what other information you could pull in from SharePoint to use
in views or in documents.
- Experiment with using Quick Parts and Fields in Word to include
information from SharePoint in documents.
- Experiment with workflows to add information into library columns for
documents, for use in views or in the documents.
- Look at part 1
part 2 of this series, if you haven't already, for information about
using metadata in views and customizing views in SharePoint Designer.
- Look for
tips about using SharePoint Designer.
- Look for other
about using writing and using workflows.
- Return to MSSharepointTips to read about other topics and ideas.
- Check out MSSQLTips.com for great
information about Microsoft SQL Server.