set default field values

  • 4
  • Question
  • Updated 2 years ago
  • Answered
Is there a simple way to hide certain fields and populate fields with default values. We are looking at moving a couple of external forms to SKUID and usually we have a couple hidden fields with default values that are specific to each form (so default field value in SF won’t work). I guess it would be rather simple to set default values and hide fields with inline javascript but it seems like a common requirement so I thought it might exist a simpler way.
Photo of Peter Baeza

Peter Baeza

  • 2,868 Points 2k badge 2x thumb

Posted 6 years ago

  • 4
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Official Response
Yes, there is a good way to do this -- you can add Conditions on your Models corresponding to each desired "Hidden Field", with the Condition's Value set to the desired "Default Value" and the State set to "Always On". This is the ideal way to do it, if the user never needs to change the field values. And, if you'd like these values to be set automatically but still be visible to the user, you can then add the corresponding Fields to your actual Field Editors / Tables / etc., but mark the Fields as Read-Only from the property builder.

When you create new records in a Skuid Model, Skuid automatically uses all Conditions on that Model whose Operator is set to "=" or "starts with" to attempt to prepopulate Fields on the new record.

So for instance if you have a "New Lead" form on your site, you'd have a Model on the Lead object, and a Field Editor tied to that Model. If you want the Lead Status to always be set to "Web", but never want the web user to have to select or see this, you could just add a Condition on the "LeadStatus" field to your Lead model with value set to "Web" and State set to "Always On".