Skip to main content

Love the fact that Skuid has added the ability to call a snippet in conditional rendering!

Unfortunately, the current design does not provide any context to the snippet that is called.  While there are some use cases that just need to globally evaluate something, more often than not what needs to be evaluated in a free-form snippet pertains specifically to the data in context (e.g. table row action, etc.)

The “context” information is present in the code path that calls the snippet so would like to see this passed through to the snippet so it can be used duration evaluation.  Without this information, many of the use cases for this feature are unattainable.

Thank you!

We’re definitely not done on this one in terms of adding features. Context should be passed into the snippet. We also plan on letting you specify when the snippet should be re-evaluated.


Happy to hear there’s more coming on this feature.  Waited a long time for this one, it’s going to make so many things so much easier.  Thanks Ben!


Yes. Just discovered the lack of arguments on the rendering snippet. Looking forward to the update!


Yup. Just discovered this as well. 😦


Voting for this and especially “We also plan on letting you specify when the snippet should be re-evaluated.”


Still waiting on this no-brainer. Another client needs this now.


I noticed rendering the element via skuid.$C(‘elementName’).render() doesn’t re-evaluate the snippet. Has anyone found a workaround for this?


Please do this soon, skuid!


Any update on this, Skuid?


I’m curious as well.


Here’s a use case where this capability would be very handy.  We have a bunch of Skuid pages that are setup to mimic the related lists that you find on Salesforce record detail pages.  These are leveraged throughout our Skuid application in a similar fashion to native Salesforce.  On each of these list pages, there is a “New” button, which will open a popup that loads another page in a page include to create a new record.  It would be handy to hide that button if the user doesn’t have access to create a record in order to prevent errors from occurring.  Here’s the current code required to do this (which requires many snippets) and how this might look with a parameter capability:

(Many Snippets)

if(skuid.utils.getAPIDescribeSObject(‘Account’) !== null)
    { 
        if( skuid.utils.getAPIDescribeSObject(‘Account’).createable == ‘true’ ) 
        {
            return true;
        }
    }
else{
    return false;
}


Here’s how it might look with a parameter approach where the pagebuilder could pass in the arguments:

(One Snippet) 

var sObject = arguments<0];
var permission = arguments 1];
var condition = argumentse2];
//other possible scenarios
var field = arguments 3];
var operation = argumentsv4];

if(skuid.utils.getAPIDescribeSObject(sObject) !== null)
    { 
        if( skuid.utils.getAPIDescribeSObject(sObject).permission == condition ) 
        {
            return true;
        }
    }
else{
    return false;
}


BUMP!!!


Bumpity Bumpity Bump!!!


bump^2


one more for luck!