Use a Workflow to Erase or Blank a Text Field in SharePoint
Sometimes, you come across a situation where you need to erase or blank out the contents of a text field in SharePoint. You don’t need to delete the item. Instead, you just need to blank a text field. Using a whitespace character just won’t cut it. To accomplish this, you will need to create a simple workflow using SharePoint Designer. Presented below are two specific ways. I’ve used one of them with SharePoint Designer 2010. I’ve used the other with SharePoint Designer 2013.
How to Blank a Text Field with a Workflow in SharePoint Designer 2013
First, create a workflow variable containing a single space character and use the Trim function to blank the variable.
Select Trim String from the Action button in the SharePoint Ribbon.
Replace the “string“ value with a single space character (” “).
Create a new variable by selecting Create New Variable after clicking the Variable: output link in the Output to parameter. Enter a name (such as “BlankString”) in the Name field. Click OK.
Select Set Field in Current Item from the Action button in the SharePoint Ribbon.
Select the field you need to blank out. In this example we’ll use one called Comments.
For the value, select Workflow Variables and Parameters in the Data Source drop down list.
In the Field from source drop down list, select your variable name. In this example we used “BlankString” so the choice to make would be Variable: BlankString.
Click OK.
There you go. You’re now able to blank a text field with a workflow in SharePoint.
How to Blank a Text Field with a Workflow in SharePoint Designer 2010
In SharePoint Designer 2010, the Trim function isn’t available. Instead, you are able to create the blank workflow variable by simple creating the workflow variable and not setting an initial value to the workflow. Just leave the variable created by selecting Create New Variable from the Action button in the SharePoint Ribbon. The image below illustrates the completed workflow.
There you go.
SharePoint Designer 2010 does not allow you to not set a value to the variable. It throws up an error if the ‘value’ field is not set. I am trying to accomplish the same thing with initializing my workflow variables to null but can’t figure out a way to do it in designer.
Any other suggestions? Thanks!
Try the following workflow step:
Copy 0 characters from end of _ (Output to Variable:BlankString)
how is this done?
Start by selecting Copy from the Action menu, then fill in the needed info.
I used the Extract Substring function to get 0 characters out of a random string and then assigned this null string to my variable and it worked! Thanks for giving the idea.
Thanks Charlie, that’s exactly what I did.
Thanks for the post. Helpful. I am new to SharePoint and have just signed up for a free SharePoint site with http://www.cloudappsportal.com
Thanks for this tip Charlie, very helpful.