Hello!I am trying to check changes from one lists to another list and having a difficult time. Anyone can share ideas how to implement it? I have this 2 lists to check for changes.One list is the "SelectedChecklist" and the other is the "GetSelectedChecklist". I need to check changes from GetSelectedChecklist to SelectedChecklist. Please see image for reference.
Hello,
I assume that GetSelectedChecklist is the original one and SelectedChecklist is the one that updated by the user, if that correct:
- You will need to loop SelectedChecklist using for each and use ListAny function (by checking with a unique identifier) to check if this item exists into GetSelectedChecklist.
- If you found the item into GetSelectedChecklist but your business requirement to check if item itself edited or not so you have to compare each attribute of that item
- If item not exist so its newly added item
- If you want to check any deleted items so you need to loop GetSelectedChecklist and check items that not exist into SelectedChecklist using ListAny also
When you say you want to check the changes between two list, does it mean you want to know that how many records are selected from original list or you want to identify the items which have the value changed for one or more attributes?
If you just want to check the selected items, you could simply use the list filter applying it on some common attribute for instance the identifier of the list records.
Whereas if you want to check on the value changes for attributes, please check the forge component to see if it meet your needs.
https://www.outsystems.com/forge/component-overview/14299/list-utilities-o11
Other option is to loop through the items in the two list and compare the attributes for changes.
Here is a similar post
https://www.outsystems.com/forums/discussion/75473/comparing-list-in-outsystem-reactive-web/
Hope it helps!
Junaid
The goal is to identify the items which have the value changed for one or more attributes.
I may suggest to convert your lists to Json and compare them using this forge component:
https://www.outsystems.com/forge/component-overview/16736/json-compare-o11
Hi RD,
You need to add below logic for resolve this issue -
if possible please share .oml file so that i will do the changes.
Thanks,
Vipin Yadav
Hii @RD.
To assist you further, I’ve attached a file that contains the relevant details or implementation steps.
Feel free to review it and let me know if you have any further questions or need clarification. I’d be happy to help.
Best regards,
Rounak Rawat
I have attached one more file if you don't want to changes on server side.
Hope it helps you,
regards
Hello @RD.
You can follow (Steps to Implement):
Define Temporary Lists:
Iterate Through Lists:
Use Conditions for Comparison:
eg: OutSystems also follows the same steps while we implement offline sync on mobile devices.
Thanks
Regards,
Gourav Shrivastava
Appreciate all your response everyone. Thank you.For this, I use the Loop and ListAny function. Checking each current SelectedChecklist one by one if there are changes and then updating it, if has changes.