How to create branch based on number of rows in model

I’m trying to create a branch that checks to see if there’s any data in a model. I can’t seem to get this to work. Here’s what I have so far.

Hey Brayden, not sure what version of Skuid you are on currently, but there was a change a little while back.

As per documentation

Warning

In previous versions of Skuid, this value was a string. If your formulas or snippets use this merge variable ensure it is interpreted as an integer.

For example:

{{$Model.NewModel.data.length}} = “1”

Hope it helps!

Thanks Dave, I’ve tried it with and without the quotations and doesn’t seem to work either way. In addition, I’ve also tried defining the model context and without and doesn’t work either way.

Maybe this is a formula that isn’t valid as a branch criteria?

-Brayden

Just a thought,

Did you try same formula in a UI field? Just to see if syntax is correct?

And if it works in formula UI-field, maybe you can reference that field in the Branch Criteria?

as well in example above they use 1 ‘=’, not sure if that makes a difference

Good idea. I will give that a try.

I would also try it without “== 0” as anything other than 0 should result in true.