AnsweredAssumed Answered

How to create a list out of an array for a SQL IN Operator

Question asked by TLongSUGF on Aug 12, 2020
Latest reply on Aug 12, 2020 by xander_bakker

I have a arcade expression that loops through a set of records and produces a comma separated list of parentrowids.


    for (var p in parentrowids) {
        array +=    p.parentrowid + ", "   ;     
var prid_array =  array;

I have a where clause a few lines down that uses the IN operator to filter on another table.  I get this error not matter how I try and produce the "array".


When I write the value to a table using this string: 

var prid_array =  "('"+ array + "')"; 

I get this: 

However the table is populated as 

('{67D92A25-79C7-4225-9AD1-C140662DEFCF}', '{F269CECB-70D3-4288-8D11-102025D3D701}', '{99AB8E1B-2759-43CA-88DE-7A5A2FDECDC6}', '')


Is there a way to output a string to be used in a IN operator?

Xander Bakker