6
Views
2
Comments
Solved
OutSystems Data Grid - changes will not be safed!
Question

Hi everyone,

I’m working on a Reactive app where an OML consumes an API to fetch project-related data. In the Data Grid, rows are auto-filled when the user types a Name in the corresponding column (using OnCellValueChange + SetCellData). That part works fine.

Now I want to persist/safe any rows the user adds, or edits/changes the user makes. It should open, the next time the Datagrid is published.

My plan:

  • I created an empty Entity that mirrors the Structure used by the grid (same attributes).
  • On Save, I intend to take the grid changes and insert/update/delete records in that Entity.
  • Next time the screen opens, I’d load from the Entity and display those saved rows in the grid.

Questions:

  • Is this approach sound/best practice for persisting Data Grid changes?
  • Should I use API_Data.GetChangedLines (Added/Updated/Deleted) and deserialize to a typed list, then map to my Entity in a Server Action?
  • Or is it better to use API_Data.GetData and persist the full grid state?

What I’ve tried:

  • Save button (Client Action) calls GetChangedLines and sends the three JSON arrays (added/updated/deleted) to a Server Action.
  • Server Action deserializes into my typed Structure list and attempts to write to the Entity.
  • I’m getting errors on save (unfortunately internal data, so I can’t share the OML). I suspect issues 

Thanks in advance for any guidance or examples! Your help so far in other threads has been super valuable.

GridSample (1).oml
2026-01-28 16-57-48
Mihai Melencu
Champion
Solution

Hi,

Your approach is partially correct, using GetChangedLines and then deserializing the lists is fine. The issue was in your SaveList server action. You need to call the corresponding action depending on the type of change:

  • Create (CreateData in your case) for new rows

  • Update for modified rows

  • Delete for removed rows

You can use CreateOrUpdate for both inserts and updates, but for performance and clarity it’s better to keep Create and Update separated.

I also adjusted how you handle the inputs by splitting them into three separate input lists, so you no longer need to use ListFilters afterward.

I’ve attached the updated OML, let me know if it works on your side.

GridSample (1).oml
UserImage.jpg
T S

Thank you Mihai! Your approach worked perfectly fine

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.