Our organisation has a requirement to report on a Deal role that is specific to our company. We need this custom property to be populated by the ‘Created by user Id’ property on the Deal, but the custom property needs to be able to be updated, so a property sync will not work.
I’m in the process of creating a workflow to copy the values from the ‘Created by user Id’ property to our custom property, but want to format the user Id to a HubSpot user and am struggling with coding this.
Have any users had any success completing this task?
This is a known issue and would require you to do one of the following things, as far as I know:
Create a workflow that enrolls deals, then branches by “Created by user ID”, then, for each ID uses the “Create record” workflow action to store the name of the user, not their ID
Develop a custom code action that contains a mapping of ID and user name and does the same as the previous bullet point however with just one action, not a potentially huge set of branches
Alternatively, you could consider the following:
Create a HubSpot user property “Deal creator”, set it to view-only
Create a deal-based workflow that copies the value from “Deal owner” to “Deal creator” once, no re-enrollment
This works under the assumption that the first owner is the creator - if it isn’t, you would have to go one of the routes outlined above. By setting the property to view-only, it would be safe from editing by regular users but super admins could still edit it and it would also be editable by workflow, for example.
This is not a good solution. The owners are not always the creator of a record.
It’s also hard not to criticize this since hubspot is doing it natively when ‘created by user ID’ is shown on views and lists. When used in workflow to fill in a user/owner property, it should be natively accepted as well.
if this can’t be done using created/updated by user ID. Then at least give us an option when setting this on owner/user properties - to set it on who created or updated the record when the trigger is update or creation.
Thanks for your valuable feedback, it means a lot to us.
You’re right, the deal owner should not be used as a proxy for the creator, since ownership can change independently.
However, the workaround shared by @karstenkoehler (thank you!) is a custom code action. Created by user ID contains a HubSpot user ID, while a HubSpot user/owner property expects the corresponding owner ID; these are separate identifiers. The Owners API returns both values, so the workflow can:
Pass hs_created_by_user_id into the custom code action.
Look up the matching owner where userId equals that value.
Return the owner’s id as a workflow output.
Use Edit record to write that output to the custom HubSpot user property.
This avoids maintaining a large hard-coded ID/name mapping.
That said, I understand that it would be great to have this natively. For new feature suggestions, I’d recommend first to search and check if this idea is already present on our Ideas Forum here. If you find a similar idea, give it an upvote and share your unique use case in the comments.