<?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: Converting a string property to an int using custom code in workflow? in &amp;#128172 RevOps Discussions</title>
    <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/854837#M2022</link>
    <description>&lt;P&gt;You can also define the datatype output in the code output return values&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2023 14:40:55 GMT</pubDate>
    <dc:creator>DanielJeal</dc:creator>
    <dc:date>2023-09-25T14:40:55Z</dc:date>
    <item>
      <title>Converting a string property to an int using custom code in workflow?</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/785144#M1803</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I've recently started deep-diving into what I would consider more advanced parts of HubSpot, and I've realized that one crucial property I use in various workflows is stored as a string instead of an integer, which limits how I can use it with list filters/workflow triggers.&lt;BR /&gt;&lt;BR /&gt;I know that there's no simple way to convert a string property to an int or float using a workflow that copies the property value, but I was wondering if this could potentially be possible using custom code in a workflow?&lt;BR /&gt;&lt;BR /&gt;I basically want to copy the contents of property X, which is a string, to property Y, which is an integer, exactly like a Python type conversion:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;int(X)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Would appreciate any help anyone can offer with this!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 22:12:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/785144#M1803</guid>
      <dc:creator>MFriberg</dc:creator>
      <dc:date>2023-04-21T22:12:47Z</dc:date>
    </item>
    <item>
      <title>Betreff: Converting a string property to an int using custom code in workflow?</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/785719#M1804</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/434363"&gt;@MFriberg&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to the Community!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to tag in a couple of subject matter experts to see if they can offer any advice: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;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/166093"&gt;@miljkovicmisa&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/148101"&gt;@ChristinaKay&lt;/a&gt;, do you have any tips for&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/434363"&gt;@MFriberg&lt;/a&gt;? Thank you!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;BR /&gt;Mia, Community Team&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 17:30:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/785719#M1804</guid>
      <dc:creator>MiaSrebrnjak</dc:creator>
      <dc:date>2023-04-24T17:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a string property to an int using custom code in workflow?</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/795935#M1844</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/101262"&gt;@MiaSrebrnjak&lt;/a&gt;!&lt;BR /&gt;&lt;BR /&gt;Do you have any other people who might be able to help with this that you could tag to get their eyes on it?&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 21:04:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/795935#M1844</guid>
      <dc:creator>MFriberg</dc:creator>
      <dc:date>2023-05-18T21:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a string property to an int using custom code in workflow?</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/854743#M2020</link>
      <description>&lt;P&gt;Hi, did you ever manage to solve this?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 12:16:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/854743#M2020</guid>
      <dc:creator>AJohnsson</dc:creator>
      <dc:date>2023-09-25T12:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a string property to an int using custom code in workflow?</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/854771#M2021</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/548968"&gt;@AJohnsson&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thank you for reaching out to the Community!&lt;BR /&gt;&lt;BR /&gt;I found these resources that might help you:&lt;BR /&gt;&lt;BR /&gt;- The solution from&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13203"&gt;@tmcmillan99&lt;/a&gt;&amp;nbsp;on this post "&lt;A href="https://community.hubspot.com/t5/CMS-Development/Convert-url-parameter-string-to-integer/m-p/443784" target="_blank" rel="noopener"&gt;Convert url parameter string to integer&lt;/A&gt;"&lt;BR /&gt;- This article "&lt;A href="https://blog.hubspot.com/website/python-casting-string-int" target="_blank" rel="noopener"&gt;Python Typecasting: How To Cast a String Into An Integer&lt;/A&gt;"&lt;BR /&gt;&lt;BR /&gt;I'd also recommend &lt;A href="https://community.hubspot.com/t5/HubSpot-Developers/ct-p/developers" target="_blank" rel="noopener"&gt;posting in our Developer Forum here&lt;/A&gt;, since it is custom code, you might be able to get help!&lt;BR /&gt;&lt;BR /&gt;I'd like to invite a couple of subject matter experts to this conversation &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/533153"&gt;@DanielJeal&lt;/a&gt;, &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&amp;nbsp;and &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/20261"&gt;@louischausse&lt;/a&gt;&amp;nbsp;do you have any suggestions to help &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/548968"&gt;@AJohnsson&lt;/a&gt;, please?&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;If anybody else has anything to add and/or share, please feel free to join in the conversation&lt;/STRONG&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks and have a good day!&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 13:15:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/854771#M2021</guid>
      <dc:creator>BérangèreL</dc:creator>
      <dc:date>2023-09-25T13:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a string property to an int using custom code in workflow?</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/854837#M2022</link>
      <description>&lt;P&gt;You can also define the datatype output in the code output return values&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 14:40:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/854837#M2022</guid>
      <dc:creator>DanielJeal</dc:creator>
      <dc:date>2023-09-25T14:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a string property to an int using custom code in workflow?</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/854863#M2023</link>
      <description>&lt;P&gt;Something like this can do it, also define output as a number and you can use it in a later 'copy values' step.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def main(event):
  # Use inputs to get data from any action in your workflow and use it in your code instead of having to use the HubSpot API.
  str_id = event["inputFields"]["id"]
  
  int_id = int(str_id)
  # Return the output data that can be used in later actions in your workflow.
  return {
    "outputFields": {
      "id": int_id
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 15:18:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Converting-a-string-property-to-an-int-using-custom-code-in/m-p/854863#M2023</guid>
      <dc:creator>DanielJeal</dc:creator>
      <dc:date>2023-09-25T15:18:25Z</dc:date>
    </item>
  </channel>
</rss>

