I have a list that I use that functions similarly to a web.config in the sense of dynamic control values that would that changes settings for workflows on the site that it is maintaining. This prevents me from having to make changes to the workflows directly and also gives users the ability to make changes to workflow controls on the fly.
Each item in the list is valued by a column named "key" and then the value of that key set to the column name "value". Both columns are string data types.
I have a workflow that uses a "Pause for Duration control". Inside the configuration I use the insert reference and set the appropriate key values for Days, hours and minutes based on the settings list using a query control that pulls the various values from the list. It stores these values as a text data type. These values are accepted by the control with no problem. Whenever I execute the workflow I receive the following error message from SharePoint:
Coercion Failed: Unable to transform the input lookup data into the requested type.
I assume this is because the value for the "pause for" is looking for a number instead of a text but I see no way to convert the string to a number through a function.
I have validated the values of the variables are being returned as text value numbers "3" "0" "0" (days, hours, minutes) and each are entered in the appropriate form fields labeled as such.
A side note:
The help section for this particular function does not outline the expected data type:
By default, the delay period will be set to 5 minutes.
Set the delay period
Manually enter values or use Insert Reference for dynamic values.
This would be very helpful to add here.
Solved! Go to Solution.
The "Convert Value" action should do the trick for you, here is an excerpt from its help file:
"This workflow action will interpret a provided text value, and store it into a workflow variable of a different type. For example, if a text variable contains a number, this action will store the value as a numeric value in a number variable. "
Can't believe I missed that one. That was it. Thanks!
I'm guessing the conversion is based off the data type of the variable that it will be stored in? There doesn't appear to be any way to tell it specifically that I want to use any particular data type outside that way.