<?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 Coded Wkflw Action - UserID Output in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Coded-Wkflw-Action-UserID-Output/m-p/1115686#M80623</link>
    <description>&lt;P&gt;Turns out there are two different user identifiers in hubspot - UserID and hubspot_owner_id. Since property change history records UserID, not the owner id, I had to use the userID to find owner id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I first tried using a search post request (&lt;A href="https://developers.hubspot.com/docs/guides/api/crm/search" target="_blank"&gt;https://developers.hubspot.com/docs/guides/api/crm/search&lt;/A&gt;) but apparently it isn't available with the owners object. So intstead I had to create code that pulls all the owners, searches for the correct userID, and finds the hubspot_owner_id of that userID - then updates the lead owner using the hubspot_owner_id.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's my first set of code for pulling the userID of the property change instigator (the property create_lead is how my workflow is triggered, so I didn't need to check for a specific value that it was changed to):&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Retrieve Property Change Instigator userID" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/139719iDB61388049FC4B38/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-27 at 10.33.59 AM.png" alt="Retrieve Property Change Instigator userID" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Retrieve Property Change Instigator userID&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my code to search owners to find the correct userID, and set the lead owner:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pull hubspot_owner_id using userID, update lead owner" style="width: 942px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/139721i0E0B4345147EBAF7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-27 at 10.48.23 AM.png" alt="pull hubspot_owner_id using userID, update lead owner" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;pull hubspot_owner_id using userID, update lead owner&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this helps someone(:&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2025 17:50:20 GMT</pubDate>
    <dc:creator>JLittle2</dc:creator>
    <dc:date>2025-02-27T17:50:20Z</dc:date>
    <item>
      <title>Custom Coded Wkflw Action - UserID Output</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Coded-Wkflw-Action-UserID-Output/m-p/1113672#M80525</link>
      <description>&lt;P&gt;I've sucessfully written code to pull the userid of the person who made the change to the property that triggers my workflow, but now I'm struggling to get that userid to be set as the lead owner.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm currently setting the UserId output as a 'number'. When I try to use action output in an edit record action (to fill the lead owner) the option is greyed out and says that the action output is not compatible. I tried outputting as a string as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to translate a custom coded action output to a userID? Or, is there a way to use the last CCA's output as an input in another custom coded action, so I can write some code to update the lead owner?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks y'all.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 16:50:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Custom-Coded-Wkflw-Action-UserID-Output/m-p/1113672#M80525</guid>
      <dc:creator>JLittle2</dc:creator>
      <dc:date>2025-02-24T16:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Coded Wkflw Action - UserID Output</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Coded-Wkflw-Action-UserID-Output/m-p/1114467#M80574</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/695698"&gt;@JLittle2&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Can you share your code? Along with screenshots of how the action is set up? It's hard to say anything for sure without testing a bit.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks! — Jaycee&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 22:24:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Custom-Coded-Wkflw-Action-UserID-Output/m-p/1114467#M80574</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2025-02-25T22:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Coded Wkflw Action - UserID Output</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Custom-Coded-Wkflw-Action-UserID-Output/m-p/1115686#M80623</link>
      <description>&lt;P&gt;Turns out there are two different user identifiers in hubspot - UserID and hubspot_owner_id. Since property change history records UserID, not the owner id, I had to use the userID to find owner id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I first tried using a search post request (&lt;A href="https://developers.hubspot.com/docs/guides/api/crm/search" target="_blank"&gt;https://developers.hubspot.com/docs/guides/api/crm/search&lt;/A&gt;) but apparently it isn't available with the owners object. So intstead I had to create code that pulls all the owners, searches for the correct userID, and finds the hubspot_owner_id of that userID - then updates the lead owner using the hubspot_owner_id.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's my first set of code for pulling the userID of the property change instigator (the property create_lead is how my workflow is triggered, so I didn't need to check for a specific value that it was changed to):&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Retrieve Property Change Instigator userID" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/139719iDB61388049FC4B38/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-27 at 10.33.59 AM.png" alt="Retrieve Property Change Instigator userID" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Retrieve Property Change Instigator userID&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my code to search owners to find the correct userID, and set the lead owner:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pull hubspot_owner_id using userID, update lead owner" style="width: 942px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/139721i0E0B4345147EBAF7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-27 at 10.48.23 AM.png" alt="pull hubspot_owner_id using userID, update lead owner" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;pull hubspot_owner_id using userID, update lead owner&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this helps someone(:&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 17:50:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Custom-Coded-Wkflw-Action-UserID-Output/m-p/1115686#M80623</guid>
      <dc:creator>JLittle2</dc:creator>
      <dc:date>2025-02-27T17:50:20Z</dc:date>
    </item>
  </channel>
</rss>

