Disclaimer
Summary
At the outset, I mention that I searched substantially from my side in the community if this topic exists or not and could not find one. Apologies in advance if this has been posted before. The community repository has become extensive over the past 9+ years and probability of repeat of a concept or a solution have increased, especially in native AppSheet functions. So, this kind of disclaimer has become necessary.
Sample App topic:
The sample app demonstrates the subtraction of a smaller enumlist from a longer enumlist and the resulting enumlist does NOT remove duplicates as it happens with AppSheet’s native list subtraction.
References:
Summary
The approach makes use of two of @Steve ‘s epic and so practically useful tips:
1)FAQ: add row per value in EnumList for looping actions.
In this lists subtractions sample app, the looping actions search each of the element in the subtracting list from the main list.
Indexof() expression shared by Steve is used to find the position of the element in the list to be subtracted form and the element is removed from the resulting list.
Limitations
Summary
I tested and it works with the following two known limitations.
- Does not process blank elements in the lists.
- The resulting list is sorted ascending, even if the original master list is not not sorted.
The approach needs two additional columns (named [Counter] and [Indexing] in the sample app) and 5 looping actions to implement.
I have tried my best to test. But I might have missed some edge cases.
Sample App:
In the sample app,
{Master List} - {Smaller List}= {Result List}
Summary
Please set up {Smaller List} using the “Select Smaller List Elements” column and simply save the form and the result will reflect in the detail view
One view “Text Lists” shows the text lists subtraction and the view “Decimal Lists” shows the decimal lists subtraction. I also tested with “price” type columns.


