I currently have a workflow that will loop through a list using the Query List Action, and use a combination of a For Each Loop and Collection operation to send contents from list items to a user specified in a list column.
what I'm trying to accomplish is send a single email to a specified user, with a collection of list items. After much searching, and experimentation I have been unsuccessful in creating this functionality.
here is the current configuration
Solved! Go to Solution.
i recommend using the "Build string" action in your loop. The action you configure to store the respective varTaskName and varDueDate in whatever format you like. Which means at the end of the loop you have one variable storing all information about task names and due dates.
The build string action could look like this:
And in the body of the mail, you just put your varMailString.
Followed your recommendation, and now I get all of the items in a single email. I'm attempting to add a link to allow the user to navigate to the list item. The link is building properly, but the list item id is taking the last list item number (36), and adding 1 to each item.
I dom't see what you are trying to accomplish there. When building the link to the list item, you enter a 36 yourself and then try to add the variable "ListItemID". You should probably delete the 36, shouldn't you?
Please clarify if i misunderstood your question.
that was a typo on my part, once I removed the extra values I was able to build a link to the list items
I have built up a new collection for the user that the task is assigned to. How could I send an email to the assigned user with all of the included tasks?
I think I dont get the question right now.
Since a Task in SharePoint is nothing but a list item, you can do the exact same thing you have done before for the list items, or do you have any certain requirement for the tasks?
After you have built your string, you send it per mail to whatever user you want.
We have built a collection of all of the list items. How can I send an email to a user that is specified in the Assigned To, with items that are assigned to them?
The same way you did it before? What is the difference now?
You can create a loop for your collection, use a build string action to format your mail text and after the loop you send the notification to the user.
Or clarify your question
Actually, I am encountering a similar issue. I have a test table like the below and I would like each Relationship Manager (RM) to receive an email with their corresponding undocumented accounts.
The way I approached this in my workflow is as follows:
1) First Query List Action: "RM" - store in collection variable "col_RMs".
2) In the collection operation I remove duplicates from the col_RMs variable and store it once more in the col_RMs variable.
3) The "For Each" is intended to perform the following tasks for each RM in the coll_RM variable.
3.1) The second "Query List Action" below is intended to filter out ALL the items (account number, name, doc status) that pertain to a single "RM". For that reason, I set the filter as the image below displays (i.e. When RM is equal to coll_RM variable). However, this gives me the following error: The execution returned an unexpected error. Exception from HRESULT: 0x80131904. I also tried to set up a collection operation before the second query to "get the RM name" in an item variable and later use the item variable (item_RM) in the filter of the second Query List. This didn't work either.
Do you know how can I filter all accounts that pertain to the specified
"Second Query List"
inside your "for each" action, you provide the name of your collection variable ("col_RMs") in the "Target collection" field. You also provide another variable for the "Store result in" field. This field will hold the currently processed collection item at runtime. So let's call this variable "singleRM".
In your second query list, you need to provide the "singleRM" variable as a filter and not the "col_RMs" as this is a collection.
If this still doesn't work, I reccomend you let the workflow display the values of your variables by logging this info to the workflow history or a dedicated sharepoint list. Unfortunately the error message is quite useless =\ but if you provided your collection variable in the filter, this should be the reason for the error.
Let us know if this is working for you.