This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import the crypto module | |
const crypto = require('crypto'); | |
exports.main = async (event, callback) => { | |
try { | |
// Example: variable from HubSpot workflow input or event | |
const inputValue = event.inputFields['hs_object_id']; | |
// Create a SHA-256 hash | |
const hash = crypto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define your webhook URL | |
const webhookUrl = 'https://webhook.site/3e9fcebf-f527-4351-aae4-bfa5c14901af'; | |
// Define the payload you want to send | |
const payload = { | |
message: 'Hello from Airtable!', | |
timestamp: new Date().toISOString() | |
}; | |
// Send the POST request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
// PUT THE FROMS/TOS IN THIS DATA VARIABLE | |
let data = JSON.stringify({ | |
"inputs": [ | |
{ | |
"from": { | |
"id": "40715675193" | |
}, | |
"to": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
exports.main = async (event, callback) => { | |
const hs_object_id = event.inputFields['hs_object_id']; | |
let data = JSON.stringify({ | |
"filterGroups": [ | |
{ | |
"filters": [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set this_time = request.query_dict.this_time %} | |
{% set todays_time = unixtimestamp(datetime.now()) %} | |
{% if todays_time - this_time > 172800000 %} | |
<h2> | |
LINK EXPIRED | |
</h2> | |
<p>The value of this_time is: {{ this_time }}</p> | |
<p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.main = async (event, callback) => { | |
/***** | |
Use inputs to get data from any action in your workflow and use it in your code instead of having to use the HubSpot API. | |
*****/ | |
const callNote = event.inputFields['hs_call_body']; | |
// Step 1: Split the string into key-value pairs | |
const keyValuePairs = callNote.split(';'); | |
// Step 2: Store values in variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.main = async (event, callback) => { | |
let state_zips = [ | |
{ "state": "AL", "zip_low": 35004, "zip_high": 36925 }, | |
{ "state": "AK", "zip_low": 99501, "zip_high": 99950 }, | |
{ "state": "AZ", "zip_low": 85001, "zip_high": 86556 }, | |
{ "state": "AR", "zip_low": 71601, "zip_high": 72959 }, | |
{ "state": "CA", "zip_low": 90001, "zip_high": 96162 }, | |
{ "state": "CO", "zip_low": 80001, "zip_high": 81658 }, | |
{ "state": "CT", "zip_low": 6001, "zip_high": 6928 }, | |
{ "state": "DE", "zip_low": 19701, "zip_high": 19980 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => 'https://api.hsforms.com/submissions/v3/integration/submit/portalId/formGuid', | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => '', | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
setTimeout(function() { | |
const emailInput = document.querySelector('input[name="2-8330456/tour_contact_email"]'); | |
emailInput.addEventListener("input", function() { | |
const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; | |
const parentDiv = emailInput.closest('.input'); | |
let messageDiv = parentDiv.querySelector('.email-error'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP SCRIPT TO MOVE PROPERTIES FROM A STANDARD OBJECT TO A CUSOTM OBJECT | |
// READ ME | |
// MODIFY THESE VARIABLES BELOW AS YOU SEE FIT (LINES 8-10) | |
// ALSO MODIFY THE GROUP NAME MAPPINGS BELOW (LINES 53-56) | |
$authToken = 'ADD_YOUR_TOKEN_HERE'; | |
$standardObject = 'contacts'; | |
$customObjectInternalName = '2-37668321'; |
NewerOlder