Hello,
Im working on a project where i have 2 lists. Both of them are displayed in the UI as tables. Goal is to add an element to certain object in a list when user edits the data through a dropdown. How can i compare the original list and the edited list to see if the certain object inside the list has been edited?
Unfortunately i cannot share the .oml file or any other detailed information related to the app.
Cheers alrdy
Hello @Ronivil
Can you please elaborate the exact requirement ?
Regards,
Pramod.
Hi Ronivil,
I don't quite understand your question, especially the "goal is to add an element to [a] certain object in a list", since it doesn't seem to align with the remainder of the question ("how can I compare the original list and the edited list").
Could you please explain better what the lists are, what happens on editing, and what you want to be able to check?
Flow is the following:
Problem is, how can i get this icon back to the original screen to the corresponding row?
Ah, ok, that's a lot more clear, thanks. The first question I would have is "how long do you want to display the icon"? If I visit the page the next day, is the icon still there?
That said, the easiest and best way is to have, in any Entity that can be created and updated by a user, four attributes:
When the user changes the values, and these changed values are saved to the database, the ModifiedOn and ModifiedBy attributes should be updated. Then, in your overview screen, you can check whether ModifiedOn is close enough to the CurrentDateTime() (e.g. using a DiffMinutes()) and if so, display the icon.
Thanks for the reply.
I unfortunately didnt realize to mention that the data used in this app is retrieved through an REST API endpoint, so theres no outsystems database in use. The icon should be displayed until the user saves the data.
Right. In that case just add a "dirty" indicator (some "IsModified" boolean) to the structure that holds the data, so you can set it when the data is changed.
You'll probably want to have that anyway, as saving the data would also be performed via REST, and you wouldn't want to "save" the records not changed.
That was my original solution for this problem. Allthough there is no empty fields in the structure where this type could be added. Is it possible to add a field to outsystems structure and just drop it off before saving the data via REST?
There's a couple of approaches you could take. In no particular order:
I'd probably go for the first solution, with the structure-as-attribute, as it's imho the most maintainable.
Although your question needs to be a bit more precise but as far as I am able to understand this can be achieved by data grid
you can refer to this doc.
https://success.outsystems.com/Documentation/How-to_Guides/Development/OutSystems_Data_Grid/How_to_use_OutSystems_Data_Grid_Web
I don't see how the data grid could help in comparing two lists?