<?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: Data Outputs Not Working in Data Hub</title>
    <link>https://community.hubspot.com/t5/Data-Hub/Data-Outputs-Not-Working/m-p/1078555#M2734</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/768166"&gt;@ahmedbs&lt;/a&gt;&lt;/SPAN&gt;, thank you for posting in our Community!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks like the issue lies in the variable name mismatch in your return statement. You defined the variable as maintDate but returned it as maint_date. Python is case-sensitive, so maintDate and maint_date are treated as different variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt; and &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/76319"&gt;@DanielSanchez&lt;/a&gt;&lt;/SPAN&gt; do you have any recommendations for &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/768166"&gt;@ahmedbs&lt;/a&gt;&lt;/SPAN&gt; matter?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Pam&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2024 22:42:31 GMT</pubDate>
    <dc:creator>PamCotton</dc:creator>
    <dc:date>2024-12-03T22:42:31Z</dc:date>
    <item>
      <title>Data Outputs Not Working</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Data-Outputs-Not-Working/m-p/1078303#M2733</link>
      <description>&lt;P&gt;from datetime import datetime&lt;BR /&gt;maintDate = ''&lt;BR /&gt;def main(event):&lt;BR /&gt;try:&lt;BR /&gt;input_fields = event.get('inputFields')&lt;BR /&gt;&lt;BR /&gt;# Get the maintenance start and end dates&lt;BR /&gt;maint_start_date = input_fields.get('maint_start_date')&lt;BR /&gt;maint_end_date = input_fields.get('maint_end_date')&lt;BR /&gt;&lt;BR /&gt;# Check if the dates are not None and are valid datetime objects&lt;BR /&gt;if maint_start_date is None or maint_end_date is None:&lt;BR /&gt;raise ValueError("Maintenance start date or end date is missing.")&lt;/P&gt;&lt;P&gt;# Assuming the dates are in string format, convert them to datetime objects&lt;BR /&gt;maint_start_date = datetime.strptime(maint_start_date, '%Y-%m-%d')&lt;BR /&gt;maint_end_date = datetime.strptime(maint_end_date, '%Y-%m-%d')&lt;/P&gt;&lt;P&gt;# Format the dates as strings&lt;BR /&gt;maintDate = maint_start_date.strftime('%Y-%m-%d') + " to " + maint_end_date.strftime('%Y-%m-%d')&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;"outputFields": {&lt;BR /&gt;"maintDate": maint_date&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;except Exception as e:&lt;BR /&gt;return {&lt;BR /&gt;"error": str(e)&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;With this above code, in the Data Outputs when I test the flow it gives me error maintDate is not defined in code.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ahmedbs_0-1733235357514.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/133019iC6E9D84BD2E61EA1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ahmedbs_0-1733235357514.png" alt="ahmedbs_0-1733235357514.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 14:17:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Data-Outputs-Not-Working/m-p/1078303#M2733</guid>
      <dc:creator>ahmedbs</dc:creator>
      <dc:date>2024-12-03T14:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Data Outputs Not Working</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Data-Outputs-Not-Working/m-p/1078555#M2734</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/768166"&gt;@ahmedbs&lt;/a&gt;&lt;/SPAN&gt;, thank you for posting in our Community!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks like the issue lies in the variable name mismatch in your return statement. You defined the variable as maintDate but returned it as maint_date. Python is case-sensitive, so maintDate and maint_date are treated as different variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt; and &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/76319"&gt;@DanielSanchez&lt;/a&gt;&lt;/SPAN&gt; do you have any recommendations for &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/768166"&gt;@ahmedbs&lt;/a&gt;&lt;/SPAN&gt; matter?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Pam&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 22:42:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Data-Outputs-Not-Working/m-p/1078555#M2734</guid>
      <dc:creator>PamCotton</dc:creator>
      <dc:date>2024-12-03T22:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Data Outputs Not Working</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Data-Outputs-Not-Working/m-p/1084680#M2776</link>
      <description>&lt;P&gt;Thanks Pam! The code got too messy and need to clean it up and figure out.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 19:31:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Data-Outputs-Not-Working/m-p/1084680#M2776</guid>
      <dc:creator>ahmedbs</dc:creator>
      <dc:date>2024-12-17T19:31:23Z</dc:date>
    </item>
  </channel>
</rss>

