Someone have any example of a query with a map wit...
# suitescript
a
Someone have any example of a query with a map with IN clause? select * from MAP_customrecord_record1_custrecord_record2 mp where mp.mapone = 8005 and maptwo IN () ? That IN clause is not working properly for me...
n
are you trying to use the MAP function in your select statement or is that the name of the field? Usually function calls are wrapped in parathesis
Copy code
SELECT MAP(['apple', 'banana', 'cherry'], (s) => LENGTH(s))
^ an example of a map function i found online
s
have you tried it with hardcoded values for the IN clause? Also, curious that you're using a table alias mp for mapone but not using it for maptwo?
a
@Shawn Talbert This is the real code:
Copy code
const sProperties = pProperties.join(',');
const sQuery = `SELECT * FROM MAP_customrecord_record1_custrecord_record2 mp WHERE mp.mapone IN (${sProperties})`;
s
hardcode an IN(...) clause to confirm it works as expected? That's what I'd do, then get fancier with variable substitution
a
I found the problem it is just hitting a database limit returning multi-selects field content…
I need to re-think that select to use multiple ORs and directly match both fields in the select query instead of just one of them…
👍 1