I need some help with doing a more complex query within a repeating group.
In my database I have a Thing ‘Jobs’ that contains a field ‘Organisation’. A job can only have one organisation but there are multiple jobs with the same organisation.
I want to display a list of jobs with each organisation having one row within a repeating group of jobs. So I need to find a way of constraining the list of jobs by a unique organisation.
What’s the best way to write this query? I’m struggling because currently I can apply ‘Unique Elements’ filter to the Thing (i.e. Jobs) rather than a specific field within the thing.
Thanks for your help. Yes I did think about that approach. I was actually looking for a more efficient way of doing it as I have over 8000 organisations in my DB so didn’t want to run a search on them.
Jobs is actually linked to a ‘User’ thing so I’m actually loading Parent Groups User -> Jobs in the repeating group which is much faster, but having issues getting the unique organisations.
‘Do a search for’ usually performs better at scale than ‘Parent Group’s User’s Jobs’. However if you’ve compared the performance and you want to keep your current setup, then I guess your User data type has a field Organisation, and you should be able to set the data source to Parent Group’s User’s Organisation?
I would also advise to use the external vertical RG so that items are loaded when user scrolls down, instead of loading them all on page load btw - but you seem experienced enough to have done that already