Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stefan 1 post 71 karma points
    May 24, 2021 @ 07:28
    Stefan
    0

    Umbraco Forms submissions to Hubspot

    Hello!

    Is there any way to send data submitted in a Umbraco form to Hubspot?

  • Aaron 58 posts 406 karma points MVP 2x c-trib
    May 24, 2021 @ 13:45
  • Dhanesh Kumar MJ 165 posts 521 karma points MVP c-trib
    May 24, 2021 @ 15:19
    Dhanesh Kumar MJ
    1

    Hi Stefan,

    Yes, we can do this by creating a custom workflow, once the workflow is created then it will be listed in the workflow section of the Umbraco form, then just configured the created workflow to the corresponding form.

    But keep in mind that the form data will save even if there is an issue occurred at the time of posting the data to HubSpot.

    Example

     public class CustomFormFlow : WorkflowType
        {
    
            public CustomFormFlow()
            {
                this.Id = new Guid("ccbeb0d5-adaa-4729-8b4c-4bb439dc0203");
                this.Name = "Custom Workflow ";
                this.Description = "This is a custom workflow";
                this.Icon = "icon-flash";
                this.Group = "Services";
            }
            public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
            {
                try
                {
    
                  //param `record` has all the data
               //you can read the value 
               record.GetRecordFieldByAlias("aliasName")?.ValuesAsString();
    var status=postDataToHubspot();
                    if (status)
                        return WorkflowExecutionStatus.Completed;
                    else
                        return WorkflowExecutionStatus.Failed;
                }
                catch (Exception ex)
                {
                    Current.Logger.Error<CustomFormFlow >(ex, "Error in CustomFormFlow ");
                    throw;
                }
            }
    

    Regards Dhanesh ;)

Please Sign in or register to post replies

Write your reply to:

Draft