'Date' field automatic filling after submitting a form

Created: 2019-04-18
Last updated: 2019-04-18

Post view count: 1041

You can use Sugester's forms in many ways - to collect leads, to report technical difficulties, to file a complaint. You can also use them to enroll your clients for courses, classes or just get their names if they want to use your services.

Forms are integrated with your CRM, you can custom them as much as you want, so they would satisfy your needs. One of the possible customization is to map a form to a client. It means that each time someone fills a form, he/she will be added to the system as a new client. System will also transfer all fields from the form to the same fields in client's profile.

This feature is very handy and saves your time. But you can go one step ahead and make your job even easier, and also use collected contacts for marketing actions with next classes/courses.

All you have to do is to activate a macro. Each time someone fills out a form, the macro will automatically fill in the date of beginning and end of the course. With that you will know not only, when a client ends his course, but also when you should offer him participation in another one. With advanced search in Clients you can create a mailing list based on this info and send a campaign with invitation for the next course.

Automation will work as follows: when a client is filling a form at your website, in Sugester's 'date' custom field a date with the beginning of the course will appear. In this case it's always a date when the form was submitted.
After saving the beginning date, the system will also automatically fill in the date when the course ends. In the example below the end date is 6 months later, counting from the beginning date.

Before you set the macro: 
  • add to a client's profile 'date' custom field, which will be filled automatically after fulfilling action script's conditions. It will help you to monitor when a client starts and ends the course
  • check the system name of the 'date' custom field - learn more here
  • check the ID for the form you want to set the macro to (click on the form and from the URL address copy numbers - in our example it's form_id to 8645)
Next, go to Settings > Account settings > Automation > Macros and filters > New filter

Fill in the name, in the Kind field select Change actions in clients

In the Condition script write down:

client.date2 == null && client.additional_fields['form_id'] == 8645 && client.date1 == null

In the Action script write down:

var count = 6;

var now = new Date();

var dd = now.getDate();

var mm = now.getMonth() + (count+ 1);

var y = now.getFullYear();


var someFormattedDate = y + '-'+ mm + '-'+ dd;

var date_now =  y + '-'+ (now.getMonth() + 1) + '-'+ dd;

Sugester.update_client(client.id, {date2: someFormattedDate, date1: date_now})


Add Comment