Hi, FlowScript behaves differently between Classic and Connect, so I’m honestly confused about which functions work where. But I have some examples in a classic workflow which might help you:
Example 1:
let usr = [name: “bob”, id: 45, orgid: 1001]
& [name: “bill”, id: 46, orgid: 1002]
& [name: “joe”, id: 47, orgid: 1002]
& [name: “joe”, id: 47, orgid: 1004]; // this org does not exist
let org = [orgname: “Ikea”, id: 1001]
& [orgname: “Novacura”, id: 1002]
& [orgname: “Flowington”, id: 1003]; //This org has no users
let LeftJoin = select name, id, firstOrEmpty(org where id = orgid).orgname as orgname, orgid from usr;
let usersWithoutOrg = usr where not any(org where id = orgid);
let usersWithtOrg = usr where any(org where id = orgid);
return LeftJoin;
//return usersWithoutOrg;
Example 2:
let usr = [name: “bob”, id: 45, orgid: 1001]
& [name: “bill”, id: 46, orgid: 1002]
& [name: “joe”, id: 47, orgid: 1002]
& [name: “Anna”, id: 47, orgid: 1004]; // this org does not exist
let org = [orgname: “Ikea”, id: 1001]
& [orgname: “Novacura”, id: 1002]
& [orgname: “Flowington”, id: 1003]; //This org has no users
let usersWithOrg = usr where any(org where id = orgid);
let usersWithoutOrg = usr where not any(org where id = orgid);
return usersWithoutOrg;