In this small article, I want to describe advanced features of our Send e-mail with attachments workflow actions.
Table of Contents
In this article, I want to share my experience working with SharePoint Workflows via SharePoint Designer. Sometimes it may be very painful, but I hope after reading the article you will not step on same rake.
Do not log Dictionary variable to Log to History
This is very common issue, your workflow just stuck in started state with following error:
Retrying last request. Next attempt scheduled in less than one minute. Details of last request: HTTP InternalServerError to https://plumsail.sharepoint.com/sites/Test/_api/web/lists(guid'04dc3f6a-968e-4ce0-a7cc-10949dfb15db')/Items Correlation Id: f54b9d7e-5242-1408-b066-5239a7b01c0a Instance Id: 967e7b1b-96cd-4fbf-b6d4-4df91199831b
Invalid text value.
A text field contains invalid data. Please check the value and try again.
It occur because your data is too big. This workflow action can display limited number of symbols. Otherwise such error occurs. As a workaround, you can use Send E-Mail with Attachments (SMTP) instead of log to history.
If you send dictionary by email you can receive it’s structure in JSON format. It is very helpful to understand the structure.
In this blog post I want to continue one of my previous articles Dynamic text and HTML templates using workflows for SharePoint 2013 or Office 365. Just in a few words to remind that in last article we have created a workflow that collects data from one list and makes two types of reports: individual and summary. These reports are delivered to user and administrator by email.
Now I will describe our new workflow action Get Items by Query (Many Lists). As you can see in documentation, it is an analogue of SPSiteDataQuery command which is exist in Server Object Model (SSOM) but it is not available in Client (CSOM). Moreover, it has additional features like grouping and sorting, which I will cover in this article.
Let’s imagine that we have something like Document Management System (DMS) based on SharePoint Online. Each our department has own site (HR, Sales, Finance, IT, etc…) and each department on own site has own document libraries structure specific to them. As in the last case, we want to build checked-out documents report, but now it should show data from all document libraries and from all sites.
In this article I will described how to query multiple lists across SharePoint sites. You can group results by specific field and then iterate through groups.
As a prof of concept I will create two workflows which send reports about checked out documents across multiple sites to individual users as well as summary report to administrator.
This is case where Get Items by Query (Many Lists) will be very useful, because it allows us to run one CAML query to many lists and as result, it will be single Dictionary object. Read more…