APIs & Integrations

Faslo
Contributor

Custom Workflow Action: Get Form Name or Form Id

 

Hi,

 

I am working on a Custom Workflow Action (https://developers.hubspot.com/docs/api/automation/custom-workflow-actions) and I have some questions about it.

 

I'll start with our problem: we have a set of Forms (both Hubspot Lead Forms and Advertising Lead Forms) which bring deals in.

 

Every form has 1-to-1 relationship with a unique Custom Object we created. When a Contact is enrolled after filling a form in, a deal should be created and based on the form it should be associated with one of the Custom Objects.

 

I already saw there is no workflow action that allows to create an association with a Custom Object. And that's where the Custom Workflow Action comes in.

I've set the custom action up in a way that grabs and sends to our external service Contact Id plus some other information, so to create a deal via the external service and do all the associations we need.

 

Nonetheless, I cannot find a way to grab either Form Id or Form Name. I know I can set a Static Input Field and create as many workflows as unique Forms, and map all the values, but that's really not ideal.

 

Also, since some Forms are hosted on advertising platform, hidden fields are not really an option (as far as I know though).

 

I've seen there's the property called hs_calculated_form_submission, but it does not seem to be particularly robust to me (string concat of all form id submissions + epoch) and all docs I've found about it are legacy docs.

 

My question then would be: is there any way (custom function, input, whatever) I can grab form id/form name in a workflow whose trigger is "contact filled {form} on any page"?

 

Bonus question: where can I see the Hubspot Form ID of a Lead Form created on Facebook/Linkedin and synced with Hubspot?

0 Upvotes
4 Replies 4
ChehakWadhdwa
Member | Diamond Partner
Member | Diamond Partner

Custom Workflow Action: Get Form Name or Form Id

Hey @Faslo

 

You can use jquery to get form's data-form-id e.g. $('.Parent--container form').attr('data-form-id');

 

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

0 Upvotes
Faslo
Contributor

Custom Workflow Action: Get Form Name or Form Id

Hi ChehakWadhdwa,

 

Thanks for your reply. Where do I need to add the Jquery string? As a function? As a Input field?

 

Also, is there a list of form attributes somewhere?

 
 
 
 
 
0 Upvotes
ChehakWadhdwa
Member | Diamond Partner
Member | Diamond Partner

Custom Workflow Action: Get Form Name or Form Id

Hey @Faslo

 

 Either use this code on within modul's JavaScript column or show me the URL of the page so that I can guide you properly.

 

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Custom Workflow Action: Get Form Name or Form Id

Hi, @Faslo 👋 Thanks for including all those details. It is an interesting, and challenging to answer, question for sure. Hey, @JBeatty @jpsanchez, do you have any thoughts on how @Faslo might approach this project? Thank you for taking a look! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes