Using a SharePoint Designer Workflow to Build a URL to Populate a Multi-Line Rich Text Field
April 23, 2010 2 Comments
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…
- 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…
- From the list of available Workflow Actions, select Build a Dynamic String
- 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.
- 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.
- Now we click on the dynamic string link (as shown in step 3), and we can start building our HTML link!
- 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.
And then repeat the process for any additional field values from the current item we want to pass through
- Now you can see, we have our URL built, and ready to go using variables from the current list item
- 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.
- And select the list by clicking on the this list link above, and then, Set this field, in our case, Description To this value,
- 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.
- And our Update List Item screen should now show the following
- Now click OK, and click Finish, and your workflow will be created and published to the server.
- 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
- Then, we’ll see our workflow that we associated to this list available under the Start a New Workflow section
- Click on our workflow, and we’ll be brought to the workflow initiation form, click on the Start button
- Once we do so, our workflow should complete successfully, and we should now have something in our Description field!
- If we hover over the link in the form, we should see it pointing to the URL that we had crafted
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.
Pingback: go here
Pingback: Sharepoint On Line | Home