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.
Visible expression:
=[[@SelectedItems]].length > 0
Actions:
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.