In order to passthrough few common prefined input values based on the form utilized, is there a way to default to automatically create a form container block with form elements.
I got Salesforce connector add on and I need to send few hidden values for each form created among visible input fields mapped. So, if there is a way to default the form elements as part of form container block then it is less time for editors to create a predefined hidden field form element when every time they want to create a new custom form container block.
Do you have these fields added to every single form created ever? If so then you can hook into the CreatedContent event, check if the content type is a form container and then add the fields yourself.
The alterantive approach is to create a custom form container block using the code below:
DisplayName = "Salesforce form container",
GUID = "16660C0A-5129-4E6C-85C0-E16161842F2D",
GroupName = "FormsContainerElements")]
public class SalesforceFormContainerBlock : FormContainerBlock
public override void SetDefaultValues(ContentType contentType)
//Add custom elements here
This then allows editors to select the form type they want and retains the ability t create non-Salesforce specfic forms as shown below:
Thanks for the reommendation.Sorry if i didnt explain the challenge I am facing properly, I am trying to default form element blocks rather form fields in my case I need to add 2 predefined hiddenItem blocks as part of the custom form container block when created by default