How to generate a document based on metadata of selected items in Lightning Tools Actions

Learn how to efficiently create documents using Lightning Tools Actions by leveraging metadata from selected items in your SharePoint environment.

 

With the [[@SelectedItems]] placeholder available in the Current list execution context of Lightning Tools Actions, you can configure the Generate document action to generate a document based on the metadata of selected items in a modern SharePoint list view.

 

ListActions.png


Visible expression:

=[[@SelectedItems]].length > 0

 

Actions:

ActionBuilder.png


An example of a Generate Word Document template:
 

 


Snippet for “Execute script - Create CAML”:

var caml = '<View><Query><OrderBy></OrderBy><Where><In><FieldRef Name="ID" /><Values>';
[[@SelectedItems.ID]].forEach(function(itemID) {
   caml +='<Value Type="Number">'+itemID+'</Value>';
});
caml += '</Values></In></Where></Query></View>';
return caml;

 

Result:

The result of the generated document based on selected items.

DocumentGenerator.png

Generated.png

Was this article helpful?

Can’t find what you’re looking for?

Our world-class Customer Success team is here for you.

Contact Support