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 EHR 
70 Madison Street, Suite 2610, Chicago, IL 60602

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

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

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