<?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: Section content refresh after serverless function hook in CRM Development Tools Beta</title>
    <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/763352#M71</link>
    <description>&lt;P&gt;I solved this problem by declaring the sections and message and just setting those within the event conditional. you can then update the sections before the sendResponse callback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let introMessage = []
let message = []
if (event &amp;amp;&amp;amp; event.type === 'SUBMIT') {
  const { example_input } = event.payload.formState;
   introMesssage = [
     {
       type: "text",
       text: "This is a plaintext string"
     },
   ]

   message = [
     {
       type: 'SUCCESS',
       body: `Form submit was successful. Input's value: ${example_input}`,
     },
   ]
}

const cardForm = [
  {
   "type": "form",
   "content": [
     {
        "type": "input",
        "name": "example_input",
        "inputType": "text",
        "label": "Example input field",
        "initialValue": "This is the default value for this field."
     },
     {
        "type": "button",
        "text": "Submit form",
        "onClick": {
          "type": "SUBMIT",
          "serverlessFunction": "exampleFunction"
        }
     }
   ]
 }
]

sendResponse({
  sections: [...introMessage, ...cardForm],
  if(message.length &amp;gt; 0) {message: [...message]}
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2023 16:52:19 GMT</pubDate>
    <dc:creator>ndwilliams3</dc:creator>
    <dc:date>2023-03-02T16:52:19Z</dc:date>
    <item>
      <title>Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/715598#M26</link>
      <description>&lt;P&gt;Hello, I've been working with the Custom CRM Cards in the middle pane and I've stumbled upon a "problem". Or, probably I am doing something wrong &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the button component example that we have in &lt;A href="https://developers.hubspot.com/docs/platform/create-custom-crm-cards-with-projects" target="_blank" rel="noopener"&gt;the documentation&lt;/A&gt;, when you click the button it triggers a serverless function hook, fetches the quote from an external API, and the data received is loaded into the section without page reload.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to do the same with a form submission, but my sections don't refresh/reload with the new data that I provide. Is there a way to trigger the sections to refresh/reload after the form submission event?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://github.com/HubSpot/ui-extensions-examples/tree/main/simple-form" target="_blank" rel="noopener"&gt;form example&lt;/A&gt; that we have is only displaying a message banner when the form is submitted and I've tried including the&lt;STRONG&gt;&amp;nbsp;sections&lt;/STRONG&gt;&amp;nbsp;with new data in the&amp;nbsp;submission event context, but I only can trigger a message banner. Sections remain the same:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if (event &amp;amp;&amp;amp; event.type === 'SUBMIT') {
    const { example_input } = event.payload.formState;
    sendResponse({
      sections: [introMessage, ...companyInfo, ...deals],
      message: {
        type: 'SUCCESS',
        body: `Form submit was successful. Input's value: ${example_input}`,
      },
    });
  }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How come the sections refresh works by invoking a serverless function with a button and not with a form submission?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 09:20:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/715598#M26</guid>
      <dc:creator>MKukanjac</dc:creator>
      <dc:date>2022-11-08T09:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/715944#M29</link>
      <description>&lt;P&gt;Hi, thanks for bringing this to our notice. Forms actions are not yet supported with different types of reactions such as card refresh or reset. It is a known issue and we are working on this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 19:15:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/715944#M29</guid>
      <dc:creator>sejal_parikh</dc:creator>
      <dc:date>2022-11-08T19:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/719205#M34</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/384808"&gt;@sejal_parikh&lt;/a&gt;&amp;nbsp;any update on this? do you know of a timeline for the fix?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 14:53:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/719205#M34</guid>
      <dc:creator>CMcKay</dc:creator>
      <dc:date>2022-11-16T14:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/719462#M36</link>
      <description>&lt;P&gt;We are trying to get it out soon, tentatively next month.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 22:02:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/719462#M36</guid>
      <dc:creator>sejal_parikh</dc:creator>
      <dc:date>2022-11-16T22:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/743152#M55</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/384808"&gt;@sejal_parikh&lt;/a&gt;&amp;nbsp;Any update on this, resetting the form fields??&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 09:50:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/743152#M55</guid>
      <dc:creator>SMohan33</dc:creator>
      <dc:date>2023-01-18T09:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/752594#M58</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/384808"&gt;@sejal_parikh&lt;/a&gt;&amp;nbsp;Any update on above issue? if it's fixed please let me know.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 07:31:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/752594#M58</guid>
      <dc:creator>SBhagat4</dc:creator>
      <dc:date>2023-02-07T07:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/753106#M59</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/486724"&gt;@SBhagat4&lt;/a&gt;&amp;nbsp;unfortunately, this will take longer than we expected. So no set timeline yet for this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are looking to refresh content after button click, you can do so by sending new sections in the response, but that's not possible for form submit.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 02:18:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/753106#M59</guid>
      <dc:creator>sejal_parikh</dc:creator>
      <dc:date>2023-02-08T02:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/753136#M60</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/384808"&gt;@sejal_parikh&lt;/a&gt;&amp;nbsp;for your quick response, I tried with button servelees action hook also but I am unable to fetch the respose&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;. Can you please suggest me how to get the respose from when we click on diffrent buttons? if you are providing some example that would be great&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/84892i7F0C2C9766CC5BBE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="button1.PNG" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/84893i21E5F4BD301D80B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="button1.PNG" alt="button1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 07:01:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/753136#M60</guid>
      <dc:creator>SBhagat4</dc:creator>
      <dc:date>2023-02-08T07:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/753875#M61</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/384808"&gt;@sejal_parikh&lt;/a&gt;&amp;nbsp;, I am wating for your respose.Please share with me asap&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 07:33:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/753875#M61</guid>
      <dc:creator>SBhagat4</dc:creator>
      <dc:date>2023-02-09T07:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/763352#M71</link>
      <description>&lt;P&gt;I solved this problem by declaring the sections and message and just setting those within the event conditional. you can then update the sections before the sendResponse callback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let introMessage = []
let message = []
if (event &amp;amp;&amp;amp; event.type === 'SUBMIT') {
  const { example_input } = event.payload.formState;
   introMesssage = [
     {
       type: "text",
       text: "This is a plaintext string"
     },
   ]

   message = [
     {
       type: 'SUCCESS',
       body: `Form submit was successful. Input's value: ${example_input}`,
     },
   ]
}

const cardForm = [
  {
   "type": "form",
   "content": [
     {
        "type": "input",
        "name": "example_input",
        "inputType": "text",
        "label": "Example input field",
        "initialValue": "This is the default value for this field."
     },
     {
        "type": "button",
        "text": "Submit form",
        "onClick": {
          "type": "SUBMIT",
          "serverlessFunction": "exampleFunction"
        }
     }
   ]
 }
]

sendResponse({
  sections: [...introMessage, ...cardForm],
  if(message.length &amp;gt; 0) {message: [...message]}
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 16:52:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/763352#M71</guid>
      <dc:creator>ndwilliams3</dc:creator>
      <dc:date>2023-03-02T16:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/763355#M72</link>
      <description>&lt;P&gt;Oh interesting, I need to try this out.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 16:56:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/763355#M72</guid>
      <dc:creator>CMcKay</dc:creator>
      <dc:date>2023-03-02T16:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/763362#M73</link>
      <description>&lt;P&gt;not sure if it was clear, but you have to submit to the same serverless function.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 17:02:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/763362#M73</guid>
      <dc:creator>ndwilliams3</dc:creator>
      <dc:date>2023-03-02T17:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/763379#M74</link>
      <description>&lt;P&gt;used this method to build a gross sales card that appends the data as a section component. The data is saved as a JSON object in a readonly property on the custom object record. Each time the form is submitted the JSON object is updated and the stat component is updated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2023-03-02 at 11.22.01 AM.png" style="width: 218px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/86531i70229BEBA187D135/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2023-03-02 at 11.22.01 AM.png" alt="Screen Shot 2023-03-02 at 11.22.01 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 17:24:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/763379#M74</guid>
      <dc:creator>ndwilliams3</dc:creator>
      <dc:date>2023-03-02T17:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Section content refresh after serverless function hook</title>
      <link>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/771226#M76</link>
      <description>&lt;P&gt;Noticing this only seems to work for sidebar cards and not for center tab cards.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 17:18:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CRM-Development-Tools-Beta/Section-content-refresh-after-serverless-function-hook/m-p/771226#M76</guid>
      <dc:creator>ndwilliams3</dc:creator>
      <dc:date>2023-03-20T17:18:31Z</dc:date>
    </item>
  </channel>
</rss>

