<?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: Custom code / Format Data -  split full name property in Data Hub</title>
    <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/901653#M2005</link>
    <description>&lt;P&gt;Hi Christoph, I have done as you show in the screenshots and get this error message :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Property to include in code is input_string&lt;BR /&gt;My two outputs are first_name, last_name&lt;BR /&gt;Language is python 3.9 and I have the property correctly mapped to include in code. Copied and pasted verbatim from above.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;[ERROR] AttributeError: 'NoneType' object has no attribute 'split'
Traceback (most recent call last):
&amp;nbsp;&amp;nbsp;File "/var/task/hubspotHandler.py", line 4, in hubspot_handler
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return file.main(event)
&amp;nbsp;&amp;nbsp;File "/var/task/file.py", line 5, in main
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name_list = full_name.split(" ")
Memory: 37/128 MB
Runtime: 10.59 ms&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jan 2024 23:27:03 GMT</pubDate>
    <dc:creator>MHarp</dc:creator>
    <dc:date>2024-01-05T23:27:03Z</dc:date>
    <item>
      <title>Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740086#M1236</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Unfortunately I didn't find any split command in the format data option.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We do pay for OPS enterprise and I would like to keep this action in house instead of exporting it to Make.com / Zapier.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Has anyone ever tried to create custom code for this split and can share it with me? (I usually work with no code / low code platforms)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 14:05:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740086#M1236</guid>
      <dc:creator>ShlomiGani</dc:creator>
      <dc:date>2023-01-11T14:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740125#M1237</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/423127"&gt;@ShlomiGani&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what is it that you need to split and what results do you need. For example, in this short Python code for a custom code action, we use an input field (assuming it is a string) and split it at spaces. The result then would be a list. So if the input string is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"&lt;SPAN&gt;Never gonna give you up Never gonna let you down&lt;/SPAN&gt;"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;['Never', 'gonna', 'give', 'you', 'up', 'Never', 'gonna', 'let', 'you', 'down']&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Here is the code:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="python"&gt;def main(event):

    input_string = event.get("inputFields").get("input_string")

    output_list = input_string.split(" ")

    return {"outputFields": {"output": output_list}}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I assume there might be more to it depending on what your input data is and what output you expect.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chriso&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Jan 2023 14:50:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740125#M1237</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-01-11T14:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740131#M1238</link>
      <description>&lt;P&gt;Just noticing the title of the thread&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt; Here it is for full name getting first and last name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def main(event):

    full_name = event.get("inputFields").get("input_string")

    name_list = full_name.split(" ")

    first_name = name_list[0]

    last_name = name_list[-1]

    return {
        "outputFields": {
            "first_name": first_name,
            "last_name": last_name,
        }
    }&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 11 Jan 2023 14:56:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740131#M1238</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-01-11T14:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740155#M1239</link>
      <description>&lt;P&gt;Hi Chrisotoph, Tnx for your quick answers.&lt;/P&gt;&lt;P&gt;Should I replace the green quets with the property lables?&lt;/P&gt;&lt;P&gt;As it is I get an eror .&lt;/P&gt;&lt;PRE&gt;[ERROR] AttributeError: 'NoneType' object has no attribute 'get'
Traceback (most recent call last)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 15:50:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740155#M1239</guid>
      <dc:creator>ShlomiGani</dc:creator>
      <dc:date>2023-01-11T15:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740499#M1242</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/423127"&gt;@ShlomiGani&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sure, let me show you how to set up the custom code action with some screenshots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The most important stuff is the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Language: Python 3.9&lt;/LI&gt;
&lt;LI&gt;Properties to include: Choose the property that holds your&amp;nbsp;&lt;EM&gt;Full Name&amp;nbsp;&lt;/EM&gt;values and give it key&amp;nbsp;&lt;EM&gt;input_string&lt;/EM&gt;&lt;/LI&gt;
&lt;LI&gt;Code: Copy and paste the provided code&lt;/LI&gt;
&lt;LI&gt;Data output: Create two data outputs as string values and call the&amp;nbsp;&lt;EM&gt;first_name&amp;nbsp;&lt;/EM&gt;and&amp;nbsp;&lt;EM&gt;last_name&amp;nbsp;&lt;/EM&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-12 at 09.13.03.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/82886i93605D5AD5C0072C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-12 at 09.13.03.png" alt="Screenshot 2023-01-12 at 09.13.03.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-12 at 09.13.17.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/82887i88C0C385ED8A9820/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-12 at 09.13.17.png" alt="Screenshot 2023-01-12 at 09.13.17.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You then can test it with a contact.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To use it in the&amp;nbsp;&lt;EM&gt;First Name&amp;nbsp;&lt;/EM&gt;and&amp;nbsp;&lt;EM&gt;Last Name&amp;nbsp;&lt;/EM&gt;properties, create two additional workflow actions with&amp;nbsp;&lt;EM&gt;Copy Property Value.&amp;nbsp;&lt;/EM&gt;Here you can copy the value from the output strings to the respective property.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-12 at 09.14.07.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/82888i522CC4A1E8459E19/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-01-12 at 09.14.07.png" alt="Screenshot 2023-01-12 at 09.14.07.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you found this post helpful, consider helping others in the community to find answers faster by marking this as a solution. I'd really appreciate it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chriso&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 08:25:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740499#M1242</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-01-12T08:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740542#M1243</link>
      <description>&lt;P&gt;Amazing.&lt;/P&gt;&lt;P&gt;Thank you very much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate it&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 10:22:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740542#M1243</guid>
      <dc:creator>ShlomiGani</dc:creator>
      <dc:date>2023-01-12T10:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740608#M1244</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;There are some names that have more than one word, so I changed the code so the first name will be the first word, but the last name will be the rest&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;last_name = full_name.replace(first_name, "")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 12:44:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740608#M1244</guid>
      <dc:creator>ShlomiGani</dc:creator>
      <dc:date>2023-01-12T12:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740622#M1245</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/423127"&gt;@ShlomiGani&lt;/a&gt;&amp;nbsp;yeah, I was expecting such a problem. The issue I see is that you never know if it is two first names or last names. Maybe depending on the culture you're operating in, one or the other is more likely. But in any case: The way you're suggesting makes sure nothing gets lost.&lt;BR /&gt;&lt;BR /&gt;The other approach could be to write an if condition in the code that returns the main function and notifies a team member to take care of that manually. Of course, doesn't scale that well.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What I'm trying to say is that no solution is entirely foolproof and there are advantages and disadvantages to everything. Thank you for the feedback and conversation, though.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chriso&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 12:57:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/740622#M1245</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-01-12T12:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/795181#M1514</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when implementing the code and "first name" contains only one name, it duplicates the first name to the last name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to prevent the code from running if there is no space and last name?&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 19:08:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/795181#M1514</guid>
      <dc:creator>LRiley32</dc:creator>
      <dc:date>2023-05-17T19:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/901653#M2005</link>
      <description>&lt;P&gt;Hi Christoph, I have done as you show in the screenshots and get this error message :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Property to include in code is input_string&lt;BR /&gt;My two outputs are first_name, last_name&lt;BR /&gt;Language is python 3.9 and I have the property correctly mapped to include in code. Copied and pasted verbatim from above.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;[ERROR] AttributeError: 'NoneType' object has no attribute 'split'
Traceback (most recent call last):
&amp;nbsp;&amp;nbsp;File "/var/task/hubspotHandler.py", line 4, in hubspot_handler
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return file.main(event)
&amp;nbsp;&amp;nbsp;File "/var/task/file.py", line 5, in main
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name_list = full_name.split(" ")
Memory: 37/128 MB
Runtime: 10.59 ms&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2024 23:27:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/901653#M2005</guid>
      <dc:creator>MHarp</dc:creator>
      <dc:date>2024-01-05T23:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/1154931#M3059</link>
      <description>&lt;P&gt;hi do i need operations hub for this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 22:16:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/1154931#M3059</guid>
      <dc:creator>Pferrara</dc:creator>
      <dc:date>2025-05-20T22:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code / Format Data -  split full name property</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/1160092#M3084</link>
      <description>&lt;P&gt;Yes. &lt;A href="https://developers.hubspot.com/docs/reference/api/automation/custom-code-actions#custom-code-workflow-actions" target="_blank" rel="noopener"&gt;Custom code workflow actions&lt;/A&gt; require&amp;nbsp;Operations Hub - Professional or higher.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 22:07:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-Format-Data-split-full-name-property/m-p/1160092#M3084</guid>
      <dc:creator>kennedyp</dc:creator>
      <dc:date>2025-06-02T22:07:02Z</dc:date>
    </item>
  </channel>
</rss>

