1.0.40 • Published 3 years ago

capture-form v1.0.40

Weekly downloads
6
License
ISC
Repository
-
Last release
3 years ago

Capture Form

Once on machine, run npm install to get dependencies.

To run locally: npm start and then you'll have to manually call displayForm(conventionId, accountId) at the end of the index.js file to have the form display.

Hosted on npm, run: npm install capture-form to install in your project.

You can test locally within a project by opening capture-form in your terminal and running: npm link Then head to your project's root directory and run: npm link capture-form Now any changes you make locally to capture-form will be reflected in your project. You'll have to run: npm run build after you make changes to capture-form in order to bundle your changes to be used by your own project.

In your React project, you'll need to import capture-form:

import { captureForm, formApp } from "capture-form"; import * as CaptureForm from "capture-form";

and include a div with an id="form-here-please" where you'd like the form to display in your html.

You can then call: (first example) captureForm(conventionId); (second example) CaptureForm.captureForm(conventionId);

to have the leadcapture form for the convention displayed. Once you hit save, the lead will be posted to Modus.

The captureForm function returns a promise. Once the lead is saved and posted successfully to Modus, the captured lead values are returned to your app:

captureForm(conventionId).then(result => console.log("Here's the result: ", result));

The result will be a JSON object with the following values:

result = { account_id: 0000, leadAttributes: { Email: "email@example.com", First Name: "Bob", Last Name: "Smith" }, lead_guid: "ABCDEF012-3456-789A-BCDEF0123456", starttime: "2020-08-01 12:05:00", tradeshow_id: 0000, user_id: 00000 }

The leadAttributes will be filled with the formfields from the convention as well as what the user filled in and saved.

Setting the guid

If you would like to set the guid for the lead yourself, you can include it as the second argument in the call:

captureForm(conventionId, guid);

This parameter is optional and captureForm() will generate its own guid for the lead if no argument is passed in the second position.

1.0.40

3 years ago

1.0.38

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.2

4 years ago

0.0.1

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago