.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

String functions in workflow (stringbuilder)

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :SharePoint


I'm trying to set a variable to a field that is a Person.  Unfortunately the person name gets set in the variable as



Is there anyway to use standard string manipulation functions in workflow definition such as

LEFT[], LENGTH [] etc




View Complete Post

More Related Resource Links

Built-in Functions - String Functions

String functions let you extract various portions of character strings, change the case of strings, concatenate and reverse strings and perform many other types of manipulations. All built-in string functions are deterministic with the exception of CHARINDEX and PATINDEX

how to trim a string value of a workflow variable using SharePoint designer.


I build a custom workflow using SP designer and have a need to trim a string value of a workflow variable. I tried using Calculation or Dynamic String builder but without success.

i store a user name type value into workflow variable called  check_name_var (string type). the logon name have this format  domainname\first_lastname 
how do i trim this value in check_name_var to only first_lastname.

Can anyone show me how or have suggest on how to accomplish this or is it possible to do this in SP designer?

Thanks for your help

Problem validating StringBuilder fields in SharePoint 2010 Custom Workflow Validators


One of our custom SharePoint Designer workflow activities, which have always worked fine in SharePoint 2007, fails to validate.

This appears to happen when a Workflow Activity that contains a StringBuilder field also contains a lookup variable.

<FieldBind Field="CustomCode" Text="this code" Id="1" DesignerType="StringBuilder" />

For example when we store the following in this StringBuilder field

"Today's date = [%Current Item:Transaction Date%]"

This field returns 'null' in the ActivityValidator. As a result we cannot validate its contents.


String and StringBuilder doubt


  String is immutable and StringBuilder is mutable. So if I change the value of a string a new memory created with the new value, whereas in StringBuilder it updates its memory location rather than creating a new memory location. So for large concatenation stringBuilders are preffered.

But  when I create a new String object, a fixed memory is created. And any changes will update its memory location, rather than creating a new memory location.

For e.g.
String s = new String();
s = String.Empty;
for ( int i=0;i<100; i++)
    //s = s + "test"  + i.ToString();
               s  =string.Concat(s, "test"  + i.ToString()); ///This is effecient compared to previous step

Now instead of String class I will use a StringBuilder class..........

StringBuilder s = new StringBuilder(String.Empty);

for ( int i=0;i<100; i++)
    //s = s + "test"  + i.ToString();
               s.append( "test"  + i.ToString());

So the question would be which one is faster and why.

Is this StringBuilder and this String equal?


So I have a StringBuilder variable and a string variable.


I simply want to know whether the contents of the StringBuilder and the string are equal.

However, I've been looking into how a StringBuilder works and when it is converted back into a string a duplicate copy of the contents is created.

Isn't that a problem with performance when the strings have a couple megabytes worth of characters in them?


Is there a better way to compare these two? Or is the only way to call StringBuilder.ToString() and then compare?

howto modify the url using (dynamic string) workflow



i have created a workflow .

i have created a variable in that variable i am passing the url of workspace.

The workspace url is like this https://ideaentityapacmicrosoftonlinecom-3.sharepoint.apac.microsoftonline.com/Sesha/default.aspx?InstanceID=1

I want to modify like this https://ideaentityapacmicrosoftonlinecom-3.sharepoint.apac.microsoftonline.com/Sesha/

ie;i want to capture upto that onlyafter that i want to add /Lists/Attendees/AllItems.aspx this after url .i am able to add this one but not able to deleted the instance id=1.after that i want to send mail to attendees.

Workflow create item returning integer... Should be a string.




Im passsing information to a new item in a different list using the create item workflow.


It seems to work from apart from one, critical field. The create item should (i hope) pass a valie from a field  'FIELD' in List A to 'FIELD' in ListB.   in list a the field is a lookup from a reference list.

The create new List item workflow ____ it but only returns the type as an integer (an its the oonly option) .

Can you explain where im going wrong?


Multiline Dynamic String Builder in SharePoint Workflow Designer

I am wanting to insert a newline or carriage return, or whatever, between two dynamic lookups inside the construct 'Dynamic String Builder'. Is this possible? The purpose of this activity in my sequential workflow is to append or concatenate the notes from each step into a multi-line string. I update the current notes into avariable called 'notesVariable', and then push it into a SP column called 'All Notes'. It works, but looks messy. Is this a bass-ackwards approach? Is there a 'best practice' that would look nicer?

Insert value using Table Value Functions

a real gem in Sql Server 2008. mostly people still using Stored procedure may be they shifted to SQL Server but they are not using TVF right now.

Introduction to Functions

A function is a section of code that is used to perform an isolated assignment. Once it has performed its assignment, the function can be accessed to present its result(s).

In Transact-SQL, a function is considered an object. After creating the function object, it becomes part of a database. You can then execute it when necessary.

Built-In Functions Fundamentals

While your primary job as a database developer consists of creating lists, probably your second most important job is to assist your users with the various assignments they must perform on your application. One way you can assist is to use functions that perform otherwise complex tasks. We introduced and described functions in the previous lesson. To assist your development with the different tasks of a database, Transact-SQL ships with various already created and tested functions. You just need to be aware of these functions, their syntax, and the results they produce.

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Free Series of SharePoint Workflow How-to Videos

This is the series of "How to" Document Workflow with SharePoint using Visual Studio 2008 (using the .NET Framework 3.0 for backward compatibility to Visual Studio 2005). I have created video's that show the most common requests that I have seen around MOSS/SharePoint 2007 workflow & document workflow.

Connestion string create any database server

This links important to how to create connection string to any data base sever.

Built-in Functions - Text and Image Functions in SQL Server

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Future versions of SQL Server will not support TEXT, NTEXT and IMAGE data types. Columns with TEXT / NTEXT data type do not support commonly used string functions such as LEN, LEFT, RIGHT, etc. Furthermore, due to the large size of TEXT data you''re likely to see performance issues if you store such data in the database. However, at times you can''t help but use the TEXT / NTEXT / IMAGE data types (for example when supporting 3rd party databases when you cannot change the schema) - this is when text and image functions come in handy.

Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions

SQL Connection String

We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners!
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend