<?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: Formatting Domains using Ops Hub in Data Hub</title>
    <link>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/875195#M1876</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/531955"&gt;@JKenler&lt;/a&gt;, I hope that you are well!&lt;BR /&gt;&lt;BR /&gt;First, I'd like to share these articles that might be of interest to you:&lt;BR /&gt;&lt;BR /&gt;-&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/workflows/format-your-data-with-workflows" target="_blank" rel="noopener"&gt;Format your data with workflows&lt;/A&gt;&lt;BR /&gt;-&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/workflows/custom-formula-functions" target="_blank" rel="noopener"&gt;Custom Formula Functions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I'd like to ask our top experts about some tips they may have: Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/101258"&gt;@Teun&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/20261"&gt;@louischausse&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&amp;nbsp;can you share information to help&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/531955"&gt;@JKenler&lt;/a&gt;, please?&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Also, if anybody else has anything to add and/or share, please feel free to join in the conversation &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; and have a lovely day!&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2023 11:39:22 GMT</pubDate>
    <dc:creator>BérangèreL</dc:creator>
    <dc:date>2023-11-06T11:39:22Z</dc:date>
    <item>
      <title>Formatting Domains using Ops Hub</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/724869#M1159</link>
      <description>&lt;P&gt;I've upgraded to Ops Hub and want to understand the best way to clean up / format domains when they're submitted via form.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For context, we have several custom objects created via forms, and the domain seems to be the best feild to associate them all (pls correct if I'm mistaken here). That said, folks will submit domains that slightly differ than what HS has on file at the Company level, (ex: including or excluding &lt;A href="http:/" target="_blank" rel="noopener"&gt;http://&lt;/A&gt;) so I need to make everything uniform arross the board.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to do this using the Format function in Ops Hub?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 17:14:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/724869#M1159</guid>
      <dc:creator>ryanjoconnor</dc:creator>
      <dc:date>2022-11-30T17:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Domains using Ops Hub</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/725245#M1160</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/427554"&gt;@ryanjoconnor&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to tag some of our experts here -&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/257487"&gt;@LMeert&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/123669"&gt;@Jonno_Price&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/452605"&gt;@crispyGTM&lt;/a&gt;&amp;nbsp;do you have any thoughts for &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/427554"&gt;@ryanjoconnor&lt;/a&gt;&amp;nbsp;on this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Tiphaine&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 10:39:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/725245#M1160</guid>
      <dc:creator>TitiCuisset</dc:creator>
      <dc:date>2022-12-01T10:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Domains using Ops Hub</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/874107#M1870</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/427554"&gt;@ryanjoconnor&lt;/a&gt;&amp;nbsp;did you ever resolve this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 21:42:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/874107#M1870</guid>
      <dc:creator>JKenler</dc:creator>
      <dc:date>2023-11-02T21:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Domains using Ops Hub</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/875195#M1876</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/531955"&gt;@JKenler&lt;/a&gt;, I hope that you are well!&lt;BR /&gt;&lt;BR /&gt;First, I'd like to share these articles that might be of interest to you:&lt;BR /&gt;&lt;BR /&gt;-&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/workflows/format-your-data-with-workflows" target="_blank" rel="noopener"&gt;Format your data with workflows&lt;/A&gt;&lt;BR /&gt;-&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/workflows/custom-formula-functions" target="_blank" rel="noopener"&gt;Custom Formula Functions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I'd like to ask our top experts about some tips they may have: Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/101258"&gt;@Teun&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/20261"&gt;@louischausse&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&amp;nbsp;can you share information to help&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/531955"&gt;@JKenler&lt;/a&gt;, please?&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Also, if anybody else has anything to add and/or share, please feel free to join in the conversation &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; and have a lovely day!&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 11:39:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/875195#M1876</guid>
      <dc:creator>BérangèreL</dc:creator>
      <dc:date>2023-11-06T11:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting Domains using Ops Hub</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/875242#M1877</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/230185"&gt;@BérangèreL&lt;/a&gt;&amp;nbsp;thank you for tagging me on this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/427554"&gt;@ryanjoconnor&lt;/a&gt; &amp;amp;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/531955"&gt;@JKenler&lt;/a&gt;&amp;nbsp; ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;happy to help you out here. This should be effortlessly possible with a short custom code workflow action. Since you mentioned Ops Hub you should be able to create one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've created a short Python script for you. Please let me know if you need help implementing that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from urllib.parse import urlparse


def main(event):
    url = event.get("inputFields").get("url")

    parsed_url = urlparse(url)
    domain = parsed_url.netloc.split(".")[
        -2:
    ]  # Extract the last two parts of the domain

    return {
        "outputFields": {
            "domain": ".".join(domain),
        }
    }
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No matter how the URL looks like, the method &lt;EM&gt;urlsparse&lt;/EM&gt; provides the opportunity to just leave with the domain name and TLD (so. example.com)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure you load the URL you want to adjust as an input field with the name&amp;nbsp;&lt;EM&gt;url&amp;nbsp;&lt;/EM&gt;and provide an output field called&amp;nbsp;&lt;EM&gt;domain. After that,&lt;/EM&gt;&amp;nbsp;you can use the&amp;nbsp;&lt;EM&gt;Copy Property Value&amp;nbsp;&lt;/EM&gt;action to copy the output into another property.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps.&amp;nbsp;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>Mon, 06 Nov 2023 13:05:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Formatting-Domains-using-Ops-Hub/m-p/875242#M1877</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2023-11-06T13:05:44Z</dc:date>
    </item>
  </channel>
</rss>

