Forum Academy Marketplace Showcase Pricing Features

Complex Sort Issue

I have created a nested RG which has an outer Do Search For which retrieves a list of Job Posts. There is also an inner Do Search For which retrieves a list of potential candidates for that Job Post.

I am performing a list intersect between required qualifications (Job Post) and held qualifications (candidate) which is displayed as a percentage.

My issue is that there is no way to sort the candidates by this intersect. I have been playing around with RepeatingGroup Tools from BDK @guarav but I don’t think it’s capable on its own of doing what I need.

Anyone able to lend some thoughts?

In this post, I see that Keith appears to provide demos of two different solutions to a similar problem, using his List Shifter plugin. I believe the second option is meant to be easier of the two.

I haven’t looked in detail at the solutions but based on the previews of the demos, they seem to work. It may not be exactly the same problem that you have but it may give you some pointers. Good luck.

Explore the following idea:

On item create (when your object is created) add a text field/s for sorting purposes and populate it/them with the names of the objects (or any necessary sortable field) that you are looking to sort.

Thanks @cmarchan ,

The issue is that 1 job post can have many candidates and 1 candidate can be suitable for many job posts. The only way i’ve found to achieve this is to create a third datatype (Suitable Candidates) which holds the candidate, job-post and score. This works, however when any detail of either candidate or job-post changes, this new object needs deleting and a new one generating which is excessively WF heavy due to the amount of fields that can and do change.

1 Like

I’ve tried playing with List Shifter before and couldn’t wrap my head around it in the slightest. I guess I’ve got some playing around to do! Thanks for the heads up

I think this is probably closest to the computationally most efficient solution. You don’t necessarily need to delete and recreate the cross table. You just need to use a cascading database trigger to recalculate the score. Make sure you run this trigger asynchronously server-side so that while a user is changing either the job or candidate profile they don’t experience any delays. This is a good use case for having a “save” button instead of real time saves on value change. The searches for top candidates become pretty simple with this pattern.

Thanks for the suggestion. This is how I was doing it originally but the WF overheads are insane. Or perhaps you mean something different? The reason the way i’m doing it is so inefficient is kind of highlighted in the image below:

The Search for Users will only be processed at the time of creating the cross table entry (suitable candidates) so for instance, if a candidate goes from being a smoker to a non-smoker, I cant update the cross table without deleting the thing and performing another Do Search For…

Or am I looking at this completely wrong?

Also @aaronsheldon, could you elaborate on the cascading DB triggers?

The way I had it set up before just had a trigger monitoring every field on the Candidate and Job Post tables. When anything changed, no matter what, all cross table entries involving the candidate or the post were erased and new ones created. Doesn’t feel very efficient considering i’ve achieved the same effect, but much faster results in two Do Search For’s… plus the score rings animate when qualifications are added or removed which is nice and the ‘cards’ showing the details don’t disappear and reappear :slight_smile: only problem is sorting…

Oh I see, you want the list of “best” candidates to change dynamically in front of the agent as the qualifications in the job post are changed. That is a much harder problem, because you either need a copy of all the candidates on the client-side, with the network overhead of that, or you have to process on the server-side with the built in workflow throttling of Bubble.

There are ways around this provided your scoring metric does not “jump” too wildly with changes in the qualifications. If this is the case then you only need to make small adjustments to the pool of candidates. What you are trying to accomplish, in real-time, is in the same family of problems as the BLAST algorithm.

With the right embedding into either a graph or vector space this becomes a convex problem. The benefit of working with convex problems is that the solution only requires keeping track of the boundaries, not every single data point.

So, to be honest you scared the living day lights out of me with your last post. I thought I might need to go back to university for a few years just to sort my RG.

Turns out @gaurav beat me to it and is fully all over this.

For anyone needing to sort nested RG’s on a calculated value between the inner RG and outer RG, BDK have your back. Between Repeating Group Tools and BDK Utilities you can achieve this and in my case it is rapid AF. Mind Blown. Just make sure the name of your RGextractor and RGdata have dynamic names by appending the outer RG index to the name.

Feel free to ask for the solution that worked for me if you’re still in difficulty. Kudos to Gaurav

1 Like

…or more likely I misinterpreted your use case, or over generalized.

1 Like

This plugin implementing fuzzy sorts is an example of an algorithm that uses a convex solution.