Blog Post

Copy Meta-Data and set content types using a SharePoint workflow

Clavin Fernandes
Illustration: Copy Meta-Data and set content types using a SharePoint workflow

At Muhimbi we take great pride in always going the extra mile. Not only do we add features and functionality specifically requested by our customers, but sometimes we add a ‘wildcard’ feature that no one has asked for. One of the wildcards we added to the very first version of the Muhimbi PDF Converter for SharePoint was the ability to copy meta data while converting a file and, based on customer feedback, people absolutely love it.

Over the years we have received various requests for additions and changes to this meta-data copying facility, but as we don’t want to cause any backwards compatibility issues we were unable to facilitate these requests. For example, half the requests were for copying the source file’s content type as well, while the other half wanted to default to the library’s default content type. Sigh…. customers :-).

We thought we would never be able to please everyone, but I think we have actually cracked it as, with the introduction of version 6.0 of the PDF Converter for SharePoint, we have added a new stand-alone Workflow Activity to copy meta-data and set content types in one easy step.

From a very high level the functionality is as follows:

  • Standalone Workflow Activity that can be used in combination with any of Muhimbi’s Workflow Activities, or without them.

  • Copy all meta-data or only selected fields.

  • Copy meta-data to files in different folders or site collections.

  • Change the content type to either the source file’s, destination file’s, the default content type for the library or a specific named content type.

  • Copy content of Author, Created and Modified fields by explicitly specifying these field names. This information is not copied when the default ‘copy all fields’ option is enabled. It is not possible to copy the Editor field as that is always overwritten by the workflow. Please note that this functionality requires the PDF Converter version 8.0 or newer.

Update: A Nintex Workflow version of this Activity is available as well.

To insert this new Activity into a workflow click the Action button in the SharePoint Designer Workflow editor and select Copy Meta Data. This inserts the following workflow sentence.

CopyMetaData

The parameters are largely self describing and use the same format as our other Workflow Activities such as Convert to PDF, Watermark PDF, Convert & Merge files, Split files, Convert HTML to PDF, Convert to non-PDF formats and Secure PDF.

  • This document: The source document to copy the meta data from. For most workflows selecting Current Item will suffice, but some custom scenarios (e.g. Site workflows) may require the look up of a different item.

  • This File: The path and file name to copy the meta-data to. Please make sure that the path does not include the host name, e.g. ‘https://your site/…’., see this post for details about specifying paths.

  • Fields: By default the content of all fields is copied to the destination file. However, if you wish to copy only specific fields then the field names can be specified in this list. You can separate fields using line breaks, ‘,’ or ‘;’ and you can use both internal and display field names.

  • Content type: While copying meta-data you have full control over the content type of the destination file. The following options can be specified:

    • (source): The content type of the source file is copied to the destination file. Please include the round brackets.

    • (target): The content type of the destination file is not modified and remains what it was before the copy operation. Please include the round brackets.

    • (default): The default content type for the document library is applied to the destination file. Please include the round brackets.

    • Name of Content type: The destination file is set to a specific, named, content type. Please do not use round brackets around the name of the content type.

  • Parameter ‘List ID’: The ID of the file the meta-data was copied to. This can later in the workflow be used to perform additional tasks on the file such as performing a check-in or out.

  • Parameter ‘List Item ID’: The ID of the list that holds the file that the meta-data was copied to.

Similar to our other Workflow Activities, this new Copy Meta Data facility is both simple and powerful and works in SharePoint 2007 as well as 2010.

Author
Clavin Fernandes Developer Relations and Support Services

Clavin is a Microsoft Business Applications MVP who supports 1,000+ high-level enterprise customers with challenges related to PDF conversion in combination with SharePoint on-premises Office 365, Azure, Nintex, K2, and Power Platform mostly no-code solutions.

Explore related topics

Share post
Free trial Ready to get started?
Free trial