Trying to figure out edit and delete in a datagrid

Hi,

I have been trying to figure out how to get editing and deletions done in a datagrid. The video that is available apparently shows functionality that has been deprecated, so I am none the wiser.

Also, my situation is a bit unique. I have a form where I collection information in 3 fields and I have an add button which (1) pushes the data to a collection and (2) then fetches the data for display in the datagrid.

This allows me to add multiple lines to the datagrid.

However, the form to add the data consists of a date picker, an autocomplete and a text field. So I can set the fields to be editable, but the picker nor the autocomplete will not show.

The only alternative that I could come up with is that on clicking edit, the data is pulled from the datagrid row and displayed in the form to be edited (with the date picked and autocomplete).

What I can’t figure out is how to get this action done in the datagrid. I have also toyed with using a table and creating a button for the edit action, but I do not know what index would be used to select the data from the particular row.

Any assistance would be appreciated.

Steve

Hi Steve, could you record a video showing us how you set up your app?

Or perhaps share some screenshots as well.

The Edit button generates an error and the Delete button bring up a confirmation popup but gives the same error

name: "Error"
fileName: "https://editor-cdn.weweb.io/ww_front/assets/index-B9T3l1R9.js line 54 > AsyncFunction"
lineNumber: 18
columnNumber: 13
message: "Failed to delete tracking record"

If this is not possible in a datagrid, I could use a table but again have the issue of referencing the row data for deleting and editing.

Hmm, here’s something new to try:

  • If both Edit and Delete trigger an error like “Failed to delete tracking record,” check if the row data includes the correct unique ID field (often id or a custom key).
  • In your workflow actions (for the buttons), log/console the value you’re passing as the record ID, it might be undefined if your datagrid or table isn’t exposing it properly. Double-check the mapping.

Hi @Agustin_Carozo ,

Sorry for the delayed response.

I figured out how to pass the record id so that the correct data is pulled from the collection. I can get the tracking number pushed back into the form but even though the Ship Date and Courier value fields show the correct data, they do not show in the form.

How can I get them to show in the form?