Add ability to run snippet when evaluating branch

  • 2
  • Idea
  • Updated 2 years ago
The new branching logic in the action framework is a welcome addition, thank you!!

Beyond the current "Formula" evaluation, would like to see the ability to call a snippet that would return true/false (similar to "Snippet returns true" in rendering conditions).  Often times, merge syntax and/or UI-only formulas are not enough to evaluate the criteria required.

A workaround would be to call a snippet before the branch to set a field on a model/row and then use that in the branch formula but being able to call a snippet directly would simplify the design, make it more intuitive to someone reviewing the page and eliminate a "tracker" model as well as the unnecessary model processing overhead just to set a true/false value.

Thank you!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 2 years ago

  • 2
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Or use the on error branch option and return false.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Another viable workaround, thanks for mentioning Pat!

I think one of the things that's really important with Skuid page development is making it as self-documenting as possible.  There is still no way to include "comments" on components/pages so having a deliberate "branch" makes the page declaration much more intuitive than either of our proposed workarounds.  Hopeful we'll see "calling a snippet" for formula added in a future release :)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Very much agree on the commenting functionality.