I am developing a Nintex Site workflow to find delayed list items(due date <= today) from multiple lists (>10) and mail them to concerned user. Each list has a column "NumberOfEscalationMails" which keeps the count of how many reminder mails have been sent. I get the delayed items using ListId variable in 'Query List'. Everything in my workflow works fine till sending mail. But the problem is after sending mail I need to increment the value in column "NumberOfEscalationMails" for each delayed item. But in 'Update Item' action there is no provision to get the list in which I have to update on basis of "List ID". It only provides a dropdown with list name. But I have to choose list dynamically (using the collection with listIds).So I am stuck here at last step! My workflow logic is as follows (Simplified to portions relevant to this question) :
-- QueryList to get all the listNames and ListIds from a configuration list and store them in WF collection variables.
-- Foreach loop to iterate through each of above lists.
-- QueryList Caml query using List ID variable to get all delayed items and store their IDs and Titles in collection variables.
-- Nested Foreach Loop to iterate through all the delayed items found above.
-- Build the Item URL and mail them to user.
-- Increment the column "NumberOfEscalationMails" value.(My Problem.)
What should be my approach now?
Solved! Go to Solution.
You can't use your master workflow tu "update item" on dynamically set List.
what i would try :
- create a dadicated list workflow for "Numberofreminder" updating
- apply this workflow on each of your target lists
- at the end of your loop on lists in master workflow, instead of trying to update item, use "Start a workflow" to launch you new workflow on each list
Thanks Thomas. This is a good idea. But I have one concern here.. I have 13 lists where I have to increment the value of column "NumberOfReminder". So just to clarify :
1- I have to create 13 workflows in each of the lists?
2- I have to use 13 start workflow actions in my Main workflow?
Also I had forgot to mention in question its a site workflow. So can I start list workflow from it?
I can't use reusable workflows here I guess because I have to choose different list in each workflow. So is there a way to optimize this? I am very new to Nintex workflow so bear with me.
I'd actually recommend just using the Webservice action pointed at SharePoint (YourSite/_vti_bin/Lists.asmx) instead of the update items action. You've got full control of which list (by guid) and can just pass in the ID for each item. With some loops and things ordered properly you should be able to accomplish your final step. Here's the XML structure you'll need inside the Webservice action once you select the UpdateListItems webservice.
<?xml version="1.0" encoding="utf-8"?>
<Method ID="1" Cmd="Update">
You should create the workflow for one of your 13 lists...then export and import it on the 12 others (and maybe adapt the settings because column naming, for example, may not be the same). And yes, you should use 13 "start workflow" actions in the main workflow.
Not sure this is the fastest way to achieve you goal, but should work... :-)
thank you for explaining the XML to update list items. It is very helpful.
I tested it successfully on a simple list.
No I have a more complex list with e.g. lookup fields and Multi line text fields with rich text.
For lookup fields I found an article to use lookup column value ID instead of text value.
Which is indeed working but makes the whole solution more complex.
What about Multi line text fields with rich text?
What I try to achieve is updating a second list with values from a master list which is having these Multi line text fields with rich text.
I use query list on master list to get all fields into variables and put these variables as new field values into the batch.
All is working fine but the Multi line text fields with rich text become stripped of all rich text properties.
Would you know if there is a solution for it?