I believe @Luis got things working using a variation on my ‘Option Two’ however he also sent me a link to his workspace and on looking at it the key part preventing it from working was that he was filtering on a collection gained from a ‘get related’ block rather than a plain search.
I have modified my original test workspace to match his and this produces results that are not how I would expect:
you’re absolutely right, I wouldn’t expect that either. Very confusing indeed, as you already suspected it’s a bug, probably in the code generation. I will get back to you as soon as we have understood and fixed the issue.
Best regards and special thanks for the detailed review of the issue!
Leo
@Jason thanks for sharing your issue and the detailed explanation.
Would it be possible for you to provide a share-link with the dummy workspace that you used for testing? I could then reproduce (and hopefully quickly resolve) your issue more efficiently by executing and observing the behaviour shown in your screenshot. You could also send me DM with the share link.
thankfully, @Jason was able to share the workspace and workflow with me to analyze it in detail.
Here’s what the flow from the screenshot does:
The flow grabs all records from the view listA in App A - that is 5 records.
Now, we get the related App C records of the current record B, which yields the two "dont list "records from C (with email address a5 and a3).
Now for the important part: We filter the record collection from 1) using an email filter with DOES NOT CONTAIN and use the Collected App C Email token. What is important here: As for all collections, this token only contains the first found record’s email (a5 or a3 depending on the order), as usual for collections. This is the specified behaviour to allow users to search for a single record, and use the resulting collection’s record values right away. Combining multiple record’s field values from a collection with multiple records would not be trivial and also not fully intuitive - think about different field types etc.
As in 3) the first found record is used, only one email is filtered out yielding 4 records as printed.
While we would agree that one might argue that this is not 100% intuitive - it is the specified behaviour indeed. We had to make the trade-off that collection tokens only contain the first record. If you need to access field values from multiple records of a collection, a loop is required.
Consecutively, what you could do in this scenario: Loop over the collected Cs and apply the FILTER COLLECTED action on each iteration. This way, you filter out all the found C’s emails. I tried that and it spits out the desired outcome, 3: