O Happy Array

By: David Williams
Date: September 27, 2013

I’ve recently had to read through a lot of data within ProcessFlow, comparing lists values, etc. and have found that using arrays is a great way to read and compare data.

Most recently I built a flow to review the HR Supervisor records and compare it against ProcessFlow Approvers to make sure the records were in sync. My old method of doing this was to cycle through HRSUPER with a Query while running another Query within the HRSUPER Query loop to see if a matching record existed in PF Admin.

While this did work, I really didn’t like running that 2nd Query 900 times! My solution this time around was to run both queries once, saving the values into two different arrays.

I then used a couple of JavaScript Expressions (within an Assign node) to compare my two arrays – one to produce a new array of new Approvers to add and the other to produce a list of Approvers to remove from PF Admin.

I then cycled through these two new arrays with a DataIterator node and used 3 WebRun nodes to add or remove the PF Admin records (User, User Task, User Task Category) as I cycled through the records.

You can do a lot with arrays. I used them recently within Design Studio to assign values from a DME and manipulate and sort the records before presenting them on my form.

David Williams, Principal Consultant

Our Headquarters

Avaap USA, LLC
510 Thornall Street, Suite 250, Edison, NJ 08837

Phone: 732.710.3425
Fax: 732.243.9550
Email: info@avaap.com

Avaap Midwest 
6 West Fifth Street, 8th Floor, St Paul, MN 55102

Avaap Chicago 
70 W Madison Street, Suite 2610, Chicago, IL 60602

Global Center of Excellence Chennai
Chennai ONE, IT SEZ, Upper Stilt, Pallavarm-Thoraipakkam, 200 ft Road, Thoraipakkam, Chennai 600096. India

Global Center of Excellence Pune
Work Lab 2.0 5512, Ganeshkhind, Aundh, Pune 411007. India

Avaap UK
Stanmore House 64-68 Blackburn Street Radcliffe, Manchester M26 2JS. England

Avaap Spain
Antonio Machado 78, Australia Building 1-A3, Viladecans, Barcelona 08840 Spain

Avaap Amsterdam
Keizersgracht 62-64 Amsterdam, Netherlands 1015CS

Technical assistance for Avaap Managed Services and Product customers: support@avaap.com