2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2020-03-22 19:39:40 -07:00
2021-12-03 00:44:16 -08:00
export const formOperations : INodeProperties [ ] = [
2020-03-22 19:39:40 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-03-22 19:39:40 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'form' ] ,
2020-03-22 19:39:40 -07:00
} ,
} ,
options : [
{
name : 'Get Fields' ,
value : 'getFields' ,
description : 'Get all fields from a form' ,
2022-07-10 13:50:51 -07:00
action : 'Get all fields from a form' ,
2020-03-22 19:39:40 -07:00
} ,
{
name : 'Submit' ,
value : 'submit' ,
description : 'Submit data to a form' ,
2022-07-10 13:50:51 -07:00
action : 'Submit a form' ,
2020-03-22 19:39:40 -07:00
} ,
] ,
default : 'getFields' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-03-22 19:39:40 -07:00
2021-12-03 00:44:16 -08:00
export const formFields : INodeProperties [ ] = [
2021-01-31 23:31:40 -08:00
/* -------------------------------------------------------------------------- */
/* form:submit */
/* -------------------------------------------------------------------------- */
2020-03-22 19:39:40 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Form Name or ID' ,
2020-03-22 19:39:40 -07:00
name : 'formId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getForms' ,
} ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'form' ] ,
operation : [ 'submit' ] ,
2020-03-22 19:39:40 -07:00
} ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'The ID of the form you\'re sending data to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'form' ] ,
operation : [ 'submit' ] ,
2020-03-22 19:39:40 -07:00
} ,
} ,
options : [
{
displayName : 'Skip Validation' ,
name : 'skipValidation' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether or not to skip validation based on the form settings' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Submitted At' ,
name : 'submittedAt' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Time of the form submission' ,
2020-03-22 19:39:40 -07:00
} ,
] ,
} ,
{
displayName : 'Context' ,
name : 'contextUi' ,
placeholder : 'Add Context' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : false ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'form' ] ,
operation : [ 'submit' ] ,
2020-03-22 19:39:40 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Context' ,
name : 'contextValue' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'HubSpot Usertoken' ,
2020-03-22 19:39:40 -07:00
name : 'hutk' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Include this parameter and set it to the hubspotutk cookie value to enable cookie tracking on your submission' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'IP Address' ,
name : 'ipAddress' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The IP address of the visitor filling out the form' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Page URI' ,
name : 'pageUri' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The URI of the page the submission happened on' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Page Name' ,
name : 'pageName' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The name or title of the page the submission happened on' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Page ID' ,
name : 'pageId' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The ID of a page created on the HubSpot CMS' ,
2020-03-22 19:39:40 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'SFDC Campaign ID' ,
2020-03-22 19:39:40 -07:00
name : 'sfdcCampaignId' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'If the form is for an account using the HubSpot Salesforce Integration, you can include the ID of a Salesforce campaign to add the contact to the specified campaign' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Go to Webinar Webinar ID' ,
name : 'goToWebinarWebinarKey' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'If the form is for an account using the HubSpot GoToWebinar Integration, you can include the ID of a webinar to enroll the contact in that webinar when they submit the form' ,
2020-03-22 19:39:40 -07:00
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Legal Consent' ,
name : 'lengalConsentUi' ,
placeholder : 'Add Legal Consent' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : false ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'form' ] ,
operation : [ 'submit' ] ,
2020-03-22 19:39:40 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Consent' ,
name : 'lengalConsentValues' ,
values : [
{
displayName : 'Consent To Process' ,
name : 'consentToProcess' ,
type : 'boolean' ,
default : false ,
description : 'Whether or not the visitor checked the Consent to process checkbox' ,
} ,
{
displayName : 'Text' ,
name : 'text' ,
type : 'string' ,
default : '' ,
description : 'The text displayed to the visitor for the Consent to process checkbox' ,
} ,
{
displayName : 'Communications' ,
name : 'communicationsUi' ,
placeholder : 'Add Communication' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
displayName : 'Communication' ,
name : 'communicationValues' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Subcription Type Name or ID' ,
2020-03-22 19:39:40 -07:00
name : 'subscriptionTypeId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getSubscriptionTypes' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'The ID of the specific subscription type. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'boolean' ,
default : false ,
2022-08-17 08:50:24 -07:00
description :
'Whether or not the visitor checked the checkbox for this subscription type' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Text' ,
name : 'text' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The text displayed to the visitor for this specific subscription checkbox' ,
2020-03-22 19:39:40 -07:00
} ,
] ,
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Legitimate Interest' ,
name : 'legitimateInterestValues' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Subcription Type Name or ID' ,
2020-03-22 19:39:40 -07:00
name : 'subscriptionTypeId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getSubscriptionTypes' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'The ID of the specific subscription type that this forms indicates interest to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2022-08-17 08:50:24 -07:00
description :
"This must be true when using the 'legitimateInterest' option, as it reflects the consent indicated by the visitor when submitting the form" ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Legal Basis' ,
name : 'legalBasis' ,
type : 'options' ,
options : [
{
name : 'Customer' ,
value : 'CUSTOMER' ,
} ,
{
name : 'Lead' ,
value : 'LEAD' ,
} ,
] ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The privacy text displayed to the visitor' ,
2020-03-22 19:39:40 -07:00
} ,
{
displayName : 'Text' ,
name : 'text' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The privacy text displayed to the visitor' ,
2020-03-22 19:39:40 -07:00
} ,
] ,
} ,
] ,
} ,
2021-01-31 23:31:40 -08:00
/* -------------------------------------------------------------------------- */
/* form:getFields */
/* -------------------------------------------------------------------------- */
2020-03-22 19:39:40 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Form Name or ID' ,
2020-03-22 19:39:40 -07:00
name : 'formId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getForms' ,
} ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'form' ] ,
operation : [ 'getFields' ] ,
2020-03-22 19:39:40 -07:00
} ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'The ID of the form. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.' ,
2020-03-22 19:39:40 -07:00
} ,
2021-12-03 00:44:16 -08:00
] ;