Advertisements

Using a SharePoint Designer Workflow to Build a URL to Populate a Multi-Line Rich Text Field


It’s been quite some time since I have had this exact problem surface for me, so, I had to run through it real quick on a development site to test out the feasibility to do this, and thought I would share…

The requirement that came to me was based on information in one list, build up a URL and some additional text to drop into a multi-line rich text field within another list, using a SharePoint Designer workflow, so no custom code was being installed on the server. The URL we will be re-directing to is a custom page with several data view web parts on it, which bring back information about the selected item.

So, let’s take a look on how to do this…

  1. Create a new workflow in SharePoint Designer, and add a step to it. Add any conditions you need met to the step, and then select the Actions drop-down, and choose More Actions…
    image
  2. From the list of available Workflow Actions, select Build a Dynamic String
    image
  3. Now, click on the Variable: variable text in the step that was just created, and select Create a new variable… from the drop-down menu that appears.
    image
  4. You will see a pop-up window appear, Edit Variable. Fill in the Name and Type fields with the name of the variable, as well as the type. In the case, we’ll be using a String.
    image
  5. Now we click on the dynamic string link (as shown in step 3), and we can start building our HTML link!
    image
  6. Now, where we get to the point when we want to add in a field from the current list item, choose Add Lookup. Select Current Item from the Source drop-down, and select the field, in this case, ID from the Field drop-down. And click OK.
    image

    And then repeat the process for any additional field values from the current item we want to pass through
    image

  7. Now you can see, we have our URL built, and ready to go using variables from the current list item
    image
  8. Next, we’ll add a second step to our workflow, to Update and item, or create, whatever you fancy, in a specific list. For the purposes of demonstrating this functionality, I am just going to update the list item I am working with. You could easily configure this to create a new list item in a different list.
    image
  9. And select the list by clicking on the this list link above, and then, Set this field, in our case, Description To this value,
    image
  10. and when we select the To this value drop-down, select the Workflow Data menu option, and choose the Variable: URL which we created earlier in this process.
    image
  11. And our Update List Item screen should now show the following
    image
  12. Now click OK, and click Finish, and your workflow will be created and published to the server.
    image
  13. Let’s go back to our site, create an item in our, list, and try this out. Select the List Item Menu for the list item you are working with, and select Workflows
    image
  14. Then, we’ll see our workflow that we associated to this list available under the Start a New Workflow section
    image 
  15. Click on our workflow, and we’ll be brought to the workflow initiation form, click on the Start button
    image
  16. Once we do so, our workflow should complete successfully, and we should now have something in our Description field!
    image 
  17. If we hover over the link in the form, we should see it pointing to the URL that we had crafted
    image

    Which should be /foo.aspx?Identifier=1&Title=Workflow Test

And that is all there is to it! Very useful functionality in SharePoint Designer Workflows for building your own dynamic variables, storing them away, and re-using them to achieve the functionality you need.

 

Advertisements

About Geoff Varosky
Geoff Varosky is a Senior Architect for BlueMetal Architects, based out of Watertown, MA. He has been architecting and developing web based applications his entire career, and has been working with SharePoint for the past 13 years. Geoff is an active member of the SharePoint community, Co-Founder and Co-Organizer of the Boston Area SharePoint Users Group, co-founder for the Boston Office 365 Users Group, co-organizer for SharePoint Saturday Boston and speaks regularly at SharePoint events and user groups.

One Response to Using a SharePoint Designer Workflow to Build a URL to Populate a Multi-Line Rich Text Field

  1. Pingback: Sharepoint On Line | Home

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: