Disabling Add and delete for a datatable and make a column read only

Hi

I have a requirement for a data table to have a set list of rows where users can’t Add or delete existing rows. Additionally the table has three columns and the first column should be read only. I am created the list item item using power automate and creating the rows on creation. Any thoughts as how to achive this?

Thanks

Samir

Hello @SamirPateluk,

You can populate Data Table control either in Power Automate or using the code: Populate Data Table with static data

The code to disable a column:

// get a column by its name
const unitPriceColumn = dt.columns.find(c => c.field === 'UnitPrice');
// make column read-only
unitPriceColumn.editable = () => false;

And see this post to learn how to hide delete and add new buttons:
Hide add and delete button in datatable