Building Dynamic Strings in SharePoint Designer Workflows

A few people have asked if it is possible to create a SharePoint Designer workflow variable that includes references to other variables. Indeed, it is possible.

The Build Dynamic String action in the Workflow Designer allows you to define any combination of static text, list field data, and workflow data in a single variable. When you click dynamic string for this action, you can look up values as needed in the String Builder dialog box, as shown here when creating a meeting request message.



To look up the value of another workflow variable, change the Source list value to Workflow Data and select the appropriate item from the Field list. In this example, the workflow already has a MeetingRequestDate variable that will be used in the dynamic string.



After you define the string value, click Variable: variable and then click Create a new variable to provide a new variable name.



It should be noted that these dynamic strings cannot be referenced when creating a task with the Assign a To-do Item action. Lookups are not allowed in the Name or Description fields of the Custom Task Wizard. However, you can reference dynamic strings when using the Send an Email action. Lookups can be performed in the To, CC, Subject, and message body fields of the Define E-mail Message dialog box.

Print | posted on Wednesday, February 28, 2007 11:03 AM

Feedback

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by Ralph Rivas at 8/22/2007 7:47 AM
Gravatar Can you add forumlas here?

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by David Gerhardt at 8/22/2007 5:27 PM
Gravatar Hi, Ralph.

Yes, you can use the Do Calculation action to save formula output to a variable. Then, you can look up that variable in the Build Dynamic String action.

Hope this helps...

Regards,
David

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by David Gerhardt at 8/29/2007 8:46 AM
Gravatar I do not know the maximum length of a string variable in a SharePoint Designer workflow. That sounds like a good question for the SharePoint Designer team (http://blogs.msdn.com/sharepointdesigner/)...

Regards,
David

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by David Gerhardt at 9/18/2007 8:31 AM
Gravatar Hi, Rob.

I would use a combination of InfoPath and SharePoint Designer for your scenario. Within the InfoPath form template, you could include button controls that set “send” data source fields based on specific email groups. InfoPath has a simple data connection wizard that allows you to pull data (e.g., with Web services) from external sources. Then, in the SharePoint Designer workflow, you could include an action to send an email message using the “send” data source fields from the InfoPath form.

Hope this helps…

Regards,
David

# Custom Workflow Strangeness

Left by Mirrored Blogs at 1/9/2008 4:54 PM
Gravatar Today I ran into two unexpected behaviors of my custom workflow (created with SharePoint designer). First

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by Dinesh at 9/12/2008 6:43 AM
Gravatar I have to find the maximum date from my data rows (Date field).

this search will be conditional as "where empId=10"

is it possible.....

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by David Gerhardt at 9/15/2008 8:16 AM
Gravatar Hi, Dinesh.

SharePoint Designer workflows do not have a built-in function that allows you to iterate through rows in a list to find maximum values. Instead, you will need a Visual Studio workflow to find a maximum value...

Regards,
David

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by Hermann at 10/20/2008 11:12 AM
Gravatar Hi,

a question related to dynamical data into a workflow you might answer.

In a custom list in sharepoint, I have a field named "Contributors" with the type "people or group" and allowing multiple values.

I want to build a workflow that automatically send an email to all the people listed in the field "Contributors" as soon as a new item of the list is created of modified.

I guess that it could help many people :-)

Any ideas ?

Many thanks

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by David Gerhardt at 10/28/2008 12:05 PM
Gravatar Hi, Hermann.

If you allow multiple selections for a "People or Group" column, then you will not be able to look up the value of that column in the To field of an SPD workflow email message. Instead, you will need to store your email addresses in a different column (e.g., a "Single line of text" column) and then do a lookup for that column.

Regards,
David

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by Bruce at 11/18/2008 7:57 AM
Gravatar How could I build a string using the value of a field (i.e., "Value1 - 111") and just return the "Value1" portion but add it to another string "SSS" to make "SSS-Value1"

thanks
BR

# re: Building Dynamic Strings in SharePoint Designer Workflows

Left by David Gerhardt at 11/18/2008 3:50 PM
Gravatar Hi, Bruce.

Unfortunately, there are no substring capabilities in SharePoint Designer workflows, so you cannot pull Value1 out of an existing string value. Unless Value1 is stored in its entirety in another column, then you would need a Visual Studio workflow to get your desired functionality.

Regards,
David

Your comment:





 
Please add 4 and 8 and type the answer here:

Copyright © David Gerhardt

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski