• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

GRISCHKE SOLUTIONS

Website and Software Development | IT | Office

  • Home
  • About
  • Services
    • Web Development & Hosting
    • IT, Networking and Cloud Solutions
    • Email and Office Solutions
    • Design Services
    • Quality Management
    • Document Management
    • Performance Dashboard
    • HR Management
    • Payroll Solutions
    • IT Support
    • GDPR
  • Blog
    • Start Jaguar Engine Remotely with Siri
    • Backup and restore IONOS DNS records using Power Automate, API, including SOA record
    • How to build an Email Parser in Microsoft Flow (Extract text from email body)
    • Windows 10 1803 new OEM (or ESP) Partition
    • Unprotect Excel Worksheets without Password
    • Data protection law is changing – you need to act now
    • Calculate Ratio Between Two Numbers
    • Charts in SharePoint
    • Microsoft SharePoint Services – What you need to know
    • Hide Featured Images in Genesis using 3 lines of code
    • Workflow loop through SharePoint list
  • Products
    • Basket
  • Enquiry

Workflow loop through SharePoint list

17th May 2017 By Maciek Grischke Leave a Comment

SharePoint 2013 Designer workflows now has two new interesting options: the ability to call HTTP web services and the option to loop over some code a number of times. This, together with the new REST API, which supports querying lists and returning data in JSON, allows iterating through list items in a workflow, something that was not possible before.

In order to demonstrate this, let’s create a new Site Workflow in SharePoint Designer, that will iterate through the Tasks list.

Call it Process Tasks, for example, and make sure you select SharePoint 2013 as the platform type.

In the workflow designer, let’s start by creating a new stage, call it Retrieve Tasks:

In it, we add a new Set Workflow Variable action which creates a new String variable called url with the value “http://sp2013/_api/web/lists/getbytitle(‘Tasks’)/items”. This uses the new REST API, and you can pass in additional options, such as for ordering by the DueDate field in descending order:

http://sp2013/_api/web/lists/getbytitle(‘Tasks’)/items?$orderby=DueDate desc

or filtering:

http://sp2013/_api/web/lists/getbytitle(‘Tasks’)/items?$filter=DueDate gt DateTime’2017-07-31T00:00:00’

or paging:

http://sp2013/_api/web/lists/getbytitle(‘Tasks’)/items?$top=20

Next, we add a Dictionary variable (Build a Dictionary action), call it requestHeaders, and initialize it as this:

Filed Under: Tutorials Tagged With: count, get, items, list, loop, sharepoint, workflow

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

  • Lock and Unlock your Jaguar with Siri
    By Maciek Grischke
    21st January 2023
  • Start Jaguar Engine Remotely with Siri
    By Maciek Grischke
    6th December 2022
  • Travel Mileage Claim Form in Power Apps using TomTom API
    By Maciek Grischke
    24th September 2022
  • Backup and restore IONOS DNS records using Power Automate, API, including SOA record
    By Maciek Grischke
    14th August 2022
  • Update the Picture column in SharePoint using PowerAutomate
    By Maciek Grischke
    16th November 2021
  • Home
  • About
  • Services
  • Blog
  • Products
  • Enquiry

 

Designed in-house by GRISCHKE SOLUTIONS © 2022 · Log in

Address

GRISCHKE SOLUTIONS
8 Sycamore Cottages
High Street
Pembury
TN2 4PJ

Site Info

Privacy Statement

Cookies Policy