<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Running workflow through a custom field in CRM Development in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Running-workflow-through-a-custom-field-in-CRM-Development/m-p/911253#M37582</link>
    <description>&lt;P&gt;Task: by clicking on the button, launch a workflow for a contact.&lt;BR /&gt;I want to enroll the contact in which the button was pressed&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2024 05:45:34 GMT</pubDate>
    <dc:creator>VladislavGavrin</dc:creator>
    <dc:date>2024-01-25T05:45:34Z</dc:date>
    <item>
      <title>Running workflow through a custom field in CRM Development</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Running-workflow-through-a-custom-field-in-CRM-Development/m-p/910766#M37572</link>
      <description>&lt;P&gt;Please tell me if there is any way to start workflow through own button or toggle switch?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;import React, { useState, useEffect } from 'react';
import {
  Button,
  Text,
  hubspot,
} from '@hubspot/ui-extensions';

hubspot.extend(({actions}) =&amp;gt; (
  &amp;lt;Extension
  fetchProperties={actions.fetchCrmObjectProperties}
  /&amp;gt;
));

const Extension = ({ fetchProperties }) =&amp;gt; {
  const post = "https://api.hubapi.com/automation/v2/workflows/:workflowsID/enrollments/contacts/";
  const [email, setemail] = useState("");
  useEffect(() =&amp;gt; {
      fetchProperties(["email"])
        .then(properties =&amp;gt; {
          setemail(properties.email);
      });
  }, [fetchProperties]);

  function myOnClickFunction() {
    fetch(post + email, {
      method: 'POST',
      headers: {
          'Accept': 'application/json',
          'Authorization': 'Bearer TOKEN',
          'Content-Type': 'application/json',
          'Content-Length': '0',
      },
  });
}
   
    return (
      &amp;lt;&amp;gt;&amp;lt;Text&amp;gt;Post:{email} &amp;lt;/Text&amp;gt;&amp;lt;Button onClick={myOnClickFunction}&amp;gt;Enroll&amp;lt;/Button&amp;gt;&amp;lt;/&amp;gt;
    );

}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Jan 2024 21:55:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Running-workflow-through-a-custom-field-in-CRM-Development/m-p/910766#M37572</guid>
      <dc:creator>VladislavGavrin</dc:creator>
      <dc:date>2024-01-24T21:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Running workflow through a custom field in CRM Development</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Running-workflow-through-a-custom-field-in-CRM-Development/m-p/911150#M37580</link>
      <description>&lt;P&gt;Hey, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/697985"&gt;@VladislavGavrin&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Can you tell us more about your project? Are you getting an error? Or is there another issue? Additionally, would this be for enrolling existing or net-new Contacts?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the additional details. — Jaycee&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 22:45:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Running-workflow-through-a-custom-field-in-CRM-Development/m-p/911150#M37580</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-01-24T22:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Running workflow through a custom field in CRM Development</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Running-workflow-through-a-custom-field-in-CRM-Development/m-p/911253#M37582</link>
      <description>&lt;P&gt;Task: by clicking on the button, launch a workflow for a contact.&lt;BR /&gt;I want to enroll the contact in which the button was pressed&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 05:45:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Running-workflow-through-a-custom-field-in-CRM-Development/m-p/911253#M37582</guid>
      <dc:creator>VladislavGavrin</dc:creator>
      <dc:date>2024-01-25T05:45:34Z</dc:date>
    </item>
  </channel>
</rss>

