The "Document Generator" allows you to generate documents based on a standard Microsoft Word file filled with SharePoint list data.
This can be triggered in actions used in list actions, modern forms or background actions (planned or triggered).
The generated document can either be downloaded directly from the browser or saved in a SharePoint library.
Main advantages:
The Document Generator function provides the possibility to create different types of documents, e.g. B:
Configuration for a single element (example: command bar action in a form):
Description ofConfiguration parameters:
The supported template format is docx. The template is created in Microsoft Word or any other software that supports docx format.
Currently skybow Document Generator allows inserting skybow placeholders, conditions, loops, nested loops and loops via table lines.
In the next versions, inserting images will also be possible.
You can find the link "Generate" on the form "Working hours for the week", which shows the dossier:
You can use different types of expressions to display the metadata in a Word document.
Templates Expressions | Any strings | [[Title]] [[First name]] | |||||||
Assignments Expressions | Start with "[[=" and any string | [[= [[Title]] + ", " + [[First name]]]] | |||||||
Function Code Expressions | Start with "[[[{" in the Tag property. Write your complex expression as content in the placeholder | [[{ var arr = [[@Web.GetValuesForQuery('OtherList', '', 'Total')]]; var sum = 0; arr.forEach(n=>sum +=n); return sum; }]]]] | |||||||
Check Values | Use [[Lookup.FieldInternalName]] to get any value from the target list of a lookup *Does not work in scheduled and triggered actions | [[Department.Code]]* [[Department.Author]]* ------------------------------------------------------------- [[Department.Key]] -> to get the item ID of the department | |||||||
If (if) conditions | Start with [[if …]] and any Boolean expression (condition). Everything between the start and end tag is visible when the condition is met. This can be a text, image, etc. | [[if [[budget]] > [[outgoings]]]] [[Title]] [[end if]] ------------------------------------------------------------- [[if {return ([[budget]]]] [[Title]] [[end if]] ------------------------------------------------------------- [[if [[Status]]!="Completed" ]]] [[Title]] [[end if]] | |||||||
Loops (grinding) | Start with [[loop]] to drag a loop over multiple elements of the selected list. If CAML Query is configured for this action link, the loop is filtered afterwards. Start with [[loop SublistTitle]] to drag a loop over the elements of the sublist filtered by looking up in the parent list. Use the filterlookupfield('filed_internal_name') parameter to specify which lookup field should be used for the sublist if there are multiple lookups for the same list. It is optional if there is only one reference field. RowLimit is also firmly encoded for 200 elements for query, but the required number can be specified with the optional parameter rowlimit(number). If a list that is not a sublist is selected (no reference option to the list selected in the action link configuration), no filtering is applied. Iteration ends with [[end loop]] | [[loop]] [[Title]] [[end loop]] ------------------------------------------------------------- [[loop SubListTitle filterlookupfield('filed_internal_name') rowlimit(number)]] [[Title]] [[First name]] [[end loop]] | |||||||
Filtered Loops | 'SomeView' is the title of a .aspx view page: The order and filter of the view are applied. When a CAML query is added (optional), it is connected to the query of the view by a 'and' operator. | [[loop SublistTitle view('SomeView') query('[[{return [[Title]];}]')]]]]]]]]]]]]]]]]]]]]]] [[Title]] [[end loop]] | |||||||
Loops about documents in sublibraries | Use the Scope="Recursive" property in the query to get documents in a folder when used as a sublibrary of a dossier. Combine recursive range and filters in the CAML query to filter the metadata of the listed documents. | [[loop SublibraryName query('')]] [[FileLeafRef]] [[Title]] [[OtherField]] [[end loop]] ------------------------------------------------------------- [[loop SublibraryName query('1')]]] [[FileLeafRef]] [[Title]] [[OtherField]] [[end loop]] | |||||||
Nested loops | A loop over a sublist within the loop over several elements of the parent list is supported. Grinding over multiple sublists or sublists of sublists is also supported. If the wildcard [[@Loop.Parent.Firstname]]] is used, the data of the rear loop can be retrieved within the nested loop. Possible formats: [[@Loop.Parent.Field1]] | [[loop]] [[Title]] [[loop SubList1]] [[Title]] [[First name]] [[end loop]] [[loop SubList2]] [[Title]] [[First name]] [[end loop]] [[end loop]] ------------------------------------------------------------- [[loop]] [[Title]] [[loop SubListTitle]] [[Title]] [[First name]] [[loop SublistTitleOfSublist]]] [[Title]] [[@Loop.Parent.Firstname]] [[end loop]] [[end loop]] [[end loop]] | |||||||
Loops in tables | It is possible to drag loops over table rows by inserting the loop inside the table. If the loop is inserted into the external table via the parent list, a separate table is created for each parent element. |
| |||||||
Image | Show an image within the document You can optionally specify the static width and height of the image as well as the maximum and minimum width and height. The parameters width/height are not mandatory and can be specified as an empty string '' or zero. Note: The wildcard [[picture...]] only works with images on the current site for planned and triggered actions | [[image]], width, height, maxwidth, maxheight, minwidth, minheight]]] Without width and height: [[image]]] Static width and height numbers used: [[image]]] Static width number used: [[image ([[Picture]], 20)]] Static height number used: [[image ([[Picture]],,150)]] [[image]], '', '', '', '', 100, 300)]] | |||||||
Create a link in the document | [[link]]]
|
The following wildcards from Expression Builder can be used in the Word template:
Not supported for use in document creation: