Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

S4S Cloud provides functionality to take data from HTML forms, but also allows sending submissions directly. This is useful for sending any data to Salesforce that does not directly use a form, or where the form is too complex for automatic processing.

let formData = {
  firstName: 'John',
  lastName: 'Smith',
  email: 'johnsmith@example.com',
};
S4SCloud.forms.send('UNIQUE_FORM_ID', formData)
  .then((data) => {
    // Successful response.
  })
  .catch((error) => {
    // Failed :-(
  });

The return value for successful sends is the same as supplied to form events, but with the values property removed. If the visitor was successfully identified, a visitorId property will also be set.

{
  "isSuccess": true,
  "error": "",
  "visitorId": ""
}
  • No labels