In this post, we will discuss how we can user Query List Nintex workflow action for Office 365 Online. Apart from this, we will also see how we can use For Each, Get-Item From Collection nintex workflow actions.
In this demo, we will see how we can query a SharePoint list data and the by using For each and Get Item from Collection we will log into history list.
Also, you can read:
–SharePoint 2016 Create the web application and Site collection using PowerShell
Query list action helps us to query data from a list in the current site. In this case, we will create a site workflow using Nintex. For this go to your SharePoint online Site Contents page. Then click on the Nintex Workflow for Office 365 app in that page. This will open the Nintex workflow Gallery. Here click on Create New Site Workflow button which will open your workflow designer.
In the workflow actions section, search for Query List workflow action. Drag and drop a Query List action to the workflow. Then search for a For Each action and then drag and drop down to Query List action. After that Drag and drop Get Item from Collection inside for each loop. Then add one Log to History List into it.
So now our workflow should look like below:
Then we need to add few variables like a blow, either you can create from the Variables button in the ribbon or you can also create while configuring each step.
Now we will configure each action. Double click on Query List workflow action to open the configure dialog box. First, select the List name from where you want to query data. Here I have chosen Editor mode as Query builder and choose the option to show all items. At the same time, you can also add some filter criteria. Then Sort based on a column.
Then you can choose Maximum number rows to show at a time (default value 100).
Output Type: There are two options for output.
Single output: Outputs all selected columns to a single collection variable.
Separate output per column: Outputs each selected column to its own collection variable.
Then we can select the columns we want to select. Then set the Output to a collection type variable which we have created earlier or you can create a new variable of a collection type.
Then in Result count select a variable of type Integer. This will store the number of results returned from the Query. It should look like below:
Then double-click on the For Each loop. Then:
Input dictionary or collection: Choose the collection variable.
Output value: Choose the single line text variable which will store the value of the variable item accessed from the dictionary or collection variable.
Output index: Select the integer variable for the storing the index of the collection variable item. It should look like below:
Then double-click on Get Item From Collection workflow action to open the configuration wizard. Choose the target collection as ItemCol variable. Index choose the MyItemIndex variable. The Output variable chooses myItemTitle variable. This variable will store the retrieved item.
Then double-click on the Log To History List workflow action as shown in the fig below, Here choose myItmeTitle variable. It should look like below:
Now Publish the workflow. Since this is a site workflow. To run the workflow, go to the Site Contents page, Then click on Site Workflows link.
It will show you all the workflows, Click on the workflows to run the workflow. Once the workflow runs successfully completed., you can see the history list, all the items are listed as shown in the fig below:
nintex forms and workflow
Hope this will be helpful.
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.
You May Also like the Following SharePoint Online Tutorials: