Create a Form Data Model based on the data source configured in the previous step
So, after you create your data source the next step is to create a Form Data Model based on that data source. So, to do that, I’ve logged into my forms instance, go into the data integrations folder and here, I’m going to create a new Form Data Model.
Give it a name here, so I’m going to call it Salesforce SFDC and select the SFDC configuration container because this is the container in which our data source resides. And then click Next here, select the SalesForceRESTAPI configuration, click Create, and then click on Edit.
So, on the left-hand side, you see the schema and the services defined in the underlying data source from the side finder here. So, from here, you can select which models or which services you want to be included in your Form Data Model. So in our use case, I want to include a service which will allow me to post the lead object into Salesforce so I’m going to click on Add selected so that adds the lead object and the result object here, click on Add. So that’s the model object here and here are the services. So, before we start using these, we need to configure it, so the first thing we need to do is to configure the right object for our lead data model object here so click on the lead object and click on its properties. So here, we need to configure the right service. So here select this and the right service would need an argument of type lead. That’s an object of type lead. So here we save it then. And then go to the Services tab here, we have the default post service which will allow us to post a lead object into the Salesforce database. So, save this. The next thing you want to do is you can try it out try out the services. So, let’s try the right service here and click on this, so that the parameters are already filled in so let’s give a valid email address here so firstname.lastname@example.org and then maybe a phone number here.
And then click on Test. So, if everything goes well you should get back an ID of the lead that was created. So now that your Form Data Model is created, the next thing that you need to do is to create an adaptive form based on this Form Data Model and on submission of the form it should create a lead in the Salesforce database. -