Hi,
In a table i have a link type column and a description column. On clicking the link column, i am launching a modal popup which has a drop-down component with a list of values and a submit button.
I want to be able to select a value from the dropdown and on submit write the value back to the description column of the selected row in the table. But when i click on the submit button nothing happens.
I am using the button event handler Run Script option with a command like Table1.selectedRow.Desc = 'Test'.
Could you please suggest options to achieve this or correct me if i am doing something wrong. I was able to reference a cell value from the table in the modal pop-up. So not sure why it is not working the other way.
Thank you.
1 Like
Hello @subbuiyer!
Thank you for reaching out on the Retool Community Forums!
Is the value you are trying set in your table something you would like to persist in your database? If so, I think the best practice here would be to have the form in your modal make an update to the description field in the selected database entry which will then be reflected in your table when the query that populates it is run again.
This is an example of what the resource query would look like. I am getting the id for the field to update from table1
and the data I want to update is from the modal's form1
.
I have a success handler on this update query set up so the query that populates my table gets refreshed after I finish the update. That way my table will show the update right away without needing to refresh the table manually.
My modal form calls the updateField
query on submission.
Let me know if that works for what you were wanting to do!
Hi @subbuiyer, I just wanted to check in and see if you got your modal form working and if there was anything else you needed.