Skip to content

synity-tech/synity-gas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SYNITY — Google Form → Bitrix24 Lead

Google Apps Script tự động đồng bộ data từ Google Form (36 cột) vào Bitrix24 CRM.

Architecture

KH điền Google Form (36 cột)
       │
       ▼
Google Sheet (Form Responses)
       │
       ▼ (installable trigger: onFormSubmit)
Google Apps Script
       │
       ├──► Bitrix24 REST API
       │      ├── Lead (create / update by phone match)
       │      ├── Contact (name, phone +84, email, chức vụ, facebook)
       │      ├── Company (tên, website)
       │      ├── Requisite (RQ_COMPANY_NAME, RQ_VAT_ID, Legal Address)
       │      ├── Timeline Comment (HTML survey results)
       │      └── Link: Contact ↔ Company ↔ Lead
       │
       └──► VietQR API
              └── MST → Tên pháp lý + Địa chỉ GPKD

Data flow

Google Form Bitrix24 entity Ghi chú
Cột 1-5: Họ tên, Email, Phone, Facebook, Vai trò Contact Phone BẮT BUỘC +84
Cột 6: Nguồn Lead SOURCE_ID Map → RECOMMENDATION / WEB / OTHER
Cột 7: Tên DN Company TITLE + Lead COMPANY_TITLE
Cột 8: MST → VietQR API Requisite + Legal Address Tên pháp lý + Địa chỉ GPKD
Cột 9: Website Company WEB
Cột 10-35: Khảo sát Lead timeline comment HTML formatted

Setup

1. Cài clasp

npm install -g @google/clasp
clasp login

2. Tạo GAS project

clasp create --type standalone --title "SYNITY Form to Bitrix"

3. Push code

clasp push

4. Cấu hình Script Properties

Mở GAS editor (clasp open), chạy function setupProperties() một lần:

BITRIX_WEBHOOK  = https://tamgiac.bitrix24.com/rest/1/xxxxx/
FORM_SHEET_ID   = 1TlJVGqQD9peFQ94oYMNOucC0jtosHiI0P0m3uUz5L4o
DEFAULT_ASSIGNED = 1
ERROR_LOG_SHEET = (optional)

QUAN TRỌNG: Thay xxxxx bằng webhook token thật. KHÔNG commit token vào Git.

5. Tạo trigger

Chạy createTrigger() một lần từ GAS editor.

6. Test

  1. Chạy testFormSubmit() từ GAS editor (dùng sample data thật)
  2. Hoặc: điền Google Form → kiểm tra Bitrix24

Kiểm tra:

  • Lead mới/cập nhật — stage = Submitted Form
  • Contact — có SĐT +84, Email, Chức vụ, Facebook
  • Company — có Website
  • Requisite — có RQ_COMPANY_NAME, RQ_VAT_ID, Legal Address
  • Timeline comment — HTML "KẾT QUẢ KHẢO SÁT NHU CẦU"

SOP gap

HONORIFIC (Danh xưng: Anh/Chị) không có trong Google Form → nhân sự bổ sung thủ công.

Dev workflow

clasp push            # Upload to GAS
clasp open            # Open GAS editor
clasp logs            # View execution logs
git add . && git commit -m "feat: ..."
git push

File structure

synity-gas/
├── src/
│   ├── main.js       # onFormSubmit handler, Bitrix + VietQR API, setup functions
│   ├── config.js     # 36-column mapping, survey sections, SOURCE_MAP, defaults
│   └── utils.js      # Phone (+84), name split, address parser, HTML builder
├── appsscript.json   # GAS manifest
├── .clasp.json       # Script ID (auto-generated)
├── .claspignore      # Exclude non-GAS files from push
├── .gitignore
├── package.json
└── README.md

Liên kết

About

Google Apps Script: Google Form → Bitrix24 Lead (36-column survey, VietQR, BBCode timeline)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors