Showing posts with label Workflow. Show all posts
Showing posts with label Workflow. Show all posts

Saturday, 30 March 2019

[Solved] SharePoint workflow 'Calculated' column cannot be used as lookup.


Error: SharePoint workflow 'Calculated' cannot be used in the query filter.

Instead of preparing the unique key using a calculated column, create a workflow to concatenate the columns and update the unique key (to fetch the row later).

Similarly, use the string builder in SharePoint designer to lookup for the desired item.

This can also be used to look up more than one column in SharePoint designer.


Note: This is not the recommended way for lists with 100s of items. Instead, prepare the concatenated key in the source data(e.g. Excel) or in the InfoPath form.

Tuesday, 14 August 2018

[Solved] SharePoint designer workflow lookup for number field is returning 0 for the blank fields.


1. One of the ways is to have a workflow variable and assign it to the lookup value. And then comparing it to 0.


2. Other way is to create a calculated text field in the list and use it instead of the number field in the workflow lookup.

Calculated text field =IF([ColumnName]=0,"-",TEXT([ColumnName],0))


=TEXT([Column],<format>) is used to avoid unwanted zeros after the decimal point. Without this, the final value for the calculated text field would look something like 123.000000000

 <format> is a number format in text format. e.g. 0; 0.0; 0.00; etc.

Wednesday, 21 February 2018

[Solved] SharePoint : The selected user(s) may not be valid on the site this workflow is published on.


Sending emails to external users:

If an email address is skipped by the SharePoint 2013 workflow then, instead of adding the email address directly into the TO/CC list add it using a workflow variable.

Create a workflow variable of type string. Assign the email address as value to this variable. And use this variable in the workflow Email.

Make this variable to return Login Name instead of string.




Also, to send emails to external users use the 2010 template of workflow instead of the 2013.

2013 workflows skips the external users while sending mailers.

Thursday, 16 March 2017

SharePoint Designer: What does a workflow lookup returns when the item is not found?


Item not found returns: ?????

Unassigned workflow variable returns: ****

Note: If you will look for ID of an item that does not exists then the variable will be assigned to 0.


Tuesday, 7 March 2017

Fixed: SharePoint 2013 workflow not starting on programmatically creating new list item.


For SharePoint 2013:

Just add "Log <this message> to the workflow history list" as the first statement in the workflow.


For SharePoint 2010:

Add below code just after item creation:

using(SPSitesite=newSPSite(web.Url))
{
  foreach(SPWorkflowAssociation spwfa in list.WorkflowAssociations)
  {
   if(spwfa.Name=="WorkFlow Name")
   {
    spwfa.AutoStartCreate=true;
  site.WorkflowManager.StartWorkflow(newItem,spwfa,spwfa.AssociationData);
   }
  }

}