I have developed a state machine workflow that is curretly working fine. Although this is working, users are complaining about being bombarded with workflow task emails that don't have anything to do with their teams. Within the doc lib I am executing the workflow, there is a column which list applications each team works on. Is there a way to get the information from this field and route to the correct group. This will be dynamic so the column value may change. The column is a drop-down field (which you cannot retrieve information from...as least I think), but I have created a calculated field to retrieve the information from drop-down so it will be in a static column. In addition, I created an external List with 3 columns to try to read from as well: Group, System, and Approvers.
I.E If user picks "Computer" out of a "System" drop-down list, everyone in Approval Group "My Computer App" should get an email based off having the string "Computer" in the field and group name, then the same goes for the other choices as well with the correct groups.
A less than optimal way with huge if-else statements I'm sure is possible....trying to make it a little more dynamic and not as hard-coded..
if (Listitem = system
createTask_taskProperties.AssignedTo = "IT Group A"
{
e.Result = true;
}
else
{
if (Listitem = system 2......
UPDATE
I am able to return the list and I can now retrieve items based upon the item ID like so
SPListItem item = list.GetItemById(26);
I need to find a way to get all values for the column/field when the workflow is triggered so I am able to pass that information to a variable. Once this is done, I should be able to call that variable in my CAML Query to determine where each item task needs to be routed. I thought I got the GUID from the column, but it was only the GUId for the list itself using this code
SPListItem item2 = list.GetItemByUniqueId[new Guid("de417a82-f221-46bd-8003-034ea45de155")];
Workflow_Initiated
event, where in you can get thedesired list
object and its column and set a global workflow variable and use that variable in your mail sending step.