Drilling down to selected data of Power Table

Hi,

I have built a database editing tool similar to the Inductive University video titled “Edit Data in Database”, however I can’t figure out to bind data in the selected row to a custom property (e.g. ‘id’). It’s not really described in the video and I found a work-around by binding the ‘id’ property to the expression: {Root Container.Power Table.selectedRow}+1… but this is a poor solution that fails after rows are deleted.

My other thought was to try {Root Container.Power Table.data}[‘id’], but this only provides the id of the first row.

How can I access data from a selected row to bind a custom property? I would like to perform this using the expression binding and not need to use {Root Container.Power Table.selectedRow} with a SQL query, which might not work anyways.

Thank you,

Michael

This should work as an expression. Though it will throw errors when no row is selected. To solve that, you can wrap it in a try, and return a safe default when no row is selected.

{Root Container.Power Table.data}[Root Container.Power Table.selectedRow,'id']

1 Like

Add one more set of braces, plus the try:

try({Root Container.Power Table.data}[{Root Container.Power Table.selectedRow},'id'], 0)
2 Likes

Great, thank you both for the quick response!