condition priority


Pat, you’re going to have to bear with me here. I watched your video like 8 times and I’m still not entirely sure what you’re suggesting. 

I understand that you want some conditions to be ignored if others are true, but what I’m not quite sure about is how Skuid is incapable of doing this in a declarative manner already by applying grouping logic. If you do something like “(1 AND 2) OR (3 AND 4)”, if “1 AND 2” evaluates to true, Skuid wont even bother checking the “3 AND 4” since the statement would resolve to true regardless of the outcome. Could you maybe give me some more information?

Well. Each condition can be given different values. If that were the case, 3 records would be in the model. I want only one model.

Basically, what I’m asking for is querying the object up to 3 times and stopping once the a record has been retrieved.

Ok, so as far as Ben and I understand your question, you can do this in the existing Skuid framework declaratively. It involves setting the “not” equivalent of your conditions, and using some fancier grouping logic. I made a video, and if it doesn’t make sense or doesn’t really address what your talking about let me know.


hehehehehehe … do tell. What’s in the Advanced Tab? :smiley:

I’m not certain this will work. Won’t the first record that fits any of these conditions be the record that is pulled into the model.

What I’m thinking is that there is nothing in your condition logic that says only evaluate the first condition, if no records are found, try the condition, if no records are found, try the last.

Under the current settings you’ve set, this model will query the object with these conditions and return a record that fits any of these conditions groupings. It can easily bring in a record that fits the last condition logical group (2 AND 4 AND 5) even though there is a record that fits the first condition.

Wouldn’t this need to work in a similar vein to how approval steps are performed. If a record doesn’t match the first criteria, it’ll move onto the next criteria to see if there’s a match, and so on…

This is what I’m thinking. In my case 3 separate queries.

So, the idea being you could add weighting/ordering to condition “groups”, which would be queried against serially until a result is found.

I think the basic question is this: Does the query logic iterate over conditions first, or records first?

Does it look at the first record against all of the conditions, then move to the next record,

Or does it look at all of the records against the first condition, and then move to the next condition?

I think the basic question is this: Does the query logic iterate over conditions first, or records first?

Does it look at the first record against all of the conditions, then move to the next record,

Or does it look at all of the records against the first condition, and then move to the next condition?

I’d bet that it  looks at the first record against all of the conditions, then move to the next record.

Yeah, Pat. That’s what I would expect, too. But from Andrew and Ben’s video, it seems they expect the other.