<?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: Text to Value in Data Hub</title>
    <link>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714058#M1113</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/192045"&gt;@PBaxter&lt;/a&gt;&amp;nbsp; HubSpot will prevent you from copying fields of different types over to one another.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Alternatively, you could change your initial string data to be in positive or negative value formats - and change the text field to a number instead. you could assume that positive values mean increases and negative values mean decreases. That would then allow you to copy the value to a number field.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2022 17:53:04 GMT</pubDate>
    <dc:creator>crispyGTM</dc:creator>
    <dc:date>2022-11-03T17:53:04Z</dc:date>
    <item>
      <title>Text to Value</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714008#M1111</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using Ops Hub to transform some incoming string data (in a text field) like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"25% increase"&lt;/P&gt;&lt;P&gt;"-10% decrease"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can easily use the replace function to strip the " % increase" and " % decrease" text to create data "25" and "10"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then I want to copy that output into a number field, and I can't see a function in Ops Hub to do a simple text to number transformation - e.g. value() or parseInt()... etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 16:55:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714008#M1111</guid>
      <dc:creator>PBaxter</dc:creator>
      <dc:date>2022-11-03T16:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Text to Value</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714058#M1113</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/192045"&gt;@PBaxter&lt;/a&gt;&amp;nbsp; HubSpot will prevent you from copying fields of different types over to one another.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Alternatively, you could change your initial string data to be in positive or negative value formats - and change the text field to a number instead. you could assume that positive values mean increases and negative values mean decreases. That would then allow you to copy the value to a number field.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 17:53:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714058#M1113</guid>
      <dc:creator>crispyGTM</dc:creator>
      <dc:date>2022-11-03T17:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Text to Value</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714114#M1114</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/192045"&gt;@PBaxter&lt;/a&gt;&amp;nbsp;You could achieve this with a coded action, simply use the value you got from your format data action in your coded action and try the following:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;exports.main = async (event, callback) =&amp;gt; {
  const valueToConvert = event.inputFields['formula_result_output'];
  const newNumberValue = Number(valueToConvert);
  callback({
    outputFields: {
      newNumberValue: newNumberValue
    }
  });
}&lt;/LI-CODE&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="Schermafbeelding 2022-11-03 om 20.11.14.png" style="width: 756px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/78452i817A841EB65DCEFA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Schermafbeelding 2022-11-03 om 20.11.14.png" alt="Schermafbeelding 2022-11-03 om 20.11.14.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 19:13:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714114#M1114</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2022-11-03T19:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Text to Value</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714116#M1115</link>
      <description>&lt;P&gt;Or with even less code:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;exports.main = async (event, callback) =&amp;gt; {
  callback({
    outputFields: {
      newNumberValue: Number(event.inputFields['formula_result_output'])
    }
  });
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Nov 2022 19:14:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714116#M1115</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2022-11-03T19:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Text to Value</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714408#M1116</link>
      <description>&lt;P&gt;You guys on here are so awesome. I'd wondered if a bit of code could address this, but it would have taken me hours to work out how to do those input/output pieces - thanks so much for the screenshots!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my solution working now after a couple of hours doing and testing the workflows.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 11:55:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Text-to-Value/m-p/714408#M1116</guid>
      <dc:creator>PBaxter</dc:creator>
      <dc:date>2022-11-04T11:55:40Z</dc:date>
    </item>
  </channel>
</rss>

