Linked list in Outsystems
Application Type
Service Studio Version
11.11.7 (Build 45559)

I'm currently trying to implement an entity that functions as a linked list by using ID's to refer to the previous and next records in the list. However, I'm having trouble with displaying the records in the order they are supposed to be in. When using a single integer to indicate the position in the list I can just sort the records according to that number but that's not possible with linked lists. Does anyone have an idea as to how I can implement this?


Well, you can't directly from SQL, as it isn't capable of looking beyond the current row, so there's no way you can create some calculated column that indicates the right position. So the best you could do is write a sorting function yourself. Also be aware that there's such a thing as loops, and broken links etc. so with bad data, you could create endless loops when sorting.

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