Get s3 signedurl from a datatable

I have a mongodb collection with image info documents. Each document has property named "image_name". The image data is stored in a s3 bucket, I have a query for the s3 bucket with the action Generate a signed url. How do I give the s3 query the key that I have to pass into the operation options, when the table renders?

I can get it to work if I use table.selectedRow.image_name.

Hello, you want to show a image with a specified key when table load right?

There is not table load event handler of new table now.

How about add success handler to your data source query of table?

and pass key in additionalScope?

Thanks @AnsonHwang for your reply.

Running a succes handler how would that work. The succes handler is triggered for the entire collection(array). How do I pass each array item key to the s3 query? And if that is possible what do I do with the result?

E.g.
The result of db query:
Row 1: NameA, keyA
Row 2: NameB, keyB

When result success, trigger script with a loop of the query or table array?:
queryS3(keyA).signedUrl returns a url string
queryS3(keyB).signedUrl returns a url string

How do I add it to the table view?

I hope it makes sense

Thx

Hey Bo! As a quick check before diving in deeper, are you looking for something like this?

https://docs.retool.com/apps/scripting-events/guides/javascript#run-an-api-request-for-each-row-in-a-table