In SharePoint 2010 designer, there is no direct option to replace the string with some other values. but in 2013, this is available. Is there any option to make this activity? I a column which is saving user names separated with semicolon. I need to replace this semicolon with tag. Please suggest me if there is any solution on this
1 Answer
You can develop custom action in Visual Studio. I have article regarding that.
Workflow (SharePoint 2013, 2010, SharePoint Online) custom action using Sandboxed Solution
The example I gave in my article will not meet your requirement though you will get basic steps of creating a Custom Action.
Areas to Change
- declare two parameter in
Element.xml. Fist one will be the input string and set theDirectiontoInand second one the output string (setDirectiontoOut). - Now in the Activity method, modify input string according to your liking and set it in the output string.
Element.xml
<Parameters>
<Parameter Name="__Context" Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext,
Microsoft.SharePoint.WorkflowActions" Direction="In" DesignerType="Hide" />
<Parameter Name="Input" Type="System.String,
mscorlib" Direction="In" DesignerType="ParameterNames" />
<Parameter Name="Output" Type="System.String,
mscorlib" Direction="Out" DesignerType="ParameterNames" />
</Parameters>
Activity method
public Hashtable CustomActivity(SPUserCodeWorkflowContext context, string Input, string Output) {
}
Let me know for any issue!!