Hey all,
I have a table that on load, will load up ~2000 results from a lookup rule using the "as new row" option.
Now from this table, I need to remove a very specific number of results which I am hoping to use JavaScript for.
Using the following code, and I get the correct number of values, but the values themselves all return empty.
LFForm.onLookupDone(async () => {
const rows = LFForm.getFieldValues({ fieldId:6 })
console.log(rows);
}, { lookupRuleId: 1 })
It seems like the onLookupDone is firing before all the values have actually finished loading into the table, because if I try adding an artificial delay before doing the getFieldValues, it loads all the values successfully.
LFForm.onLookupDone(async function() {
await new Promise((res) => setTimeout(res, 1000))
const rows = LFForm.getFieldValues({ fieldId:6 })
console.log(rows);
}, { lookupRuleId: 1 })
Any advice on how I should proceed from here?
Thanks