Help

Discover what data silos are costing your org in our commissioned Forrester study. Learn more

How to use the ReadonlyArray.find method

Topic Labels: Extensions
Solved
Jump to Solution
103 1
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi.

Imagine that I have this:

let result = await table.selectRecordsAsync({fields: table.fields});

Navigating the API, I saw we can do this:

result.records.find(…)

but I cant’ fin any example. Can you explain how to use it?

Thanks in advance.

1 Solution

Accepted Solutions

Hi @Guillermo_Ramos_Rui1,

so records.find() is simply using the Find() Javascript array method on the records array. Please read about find() here: Array.prototype.find() - JavaScript | MDN

Find requires a testing function inside and will give you the first array item that satisfied the function.

So something like: result.records.find(rec => rec.getCellValue("Name") === "Bob")

See Solution in Thread

1 Reply 1

Hi @Guillermo_Ramos_Rui1,

so records.find() is simply using the Find() Javascript array method on the records array. Please read about find() here: Array.prototype.find() - JavaScript | MDN

Find requires a testing function inside and will give you the first array item that satisfied the function.

So something like: result.records.find(rec => rec.getCellValue("Name") === "Bob")