APIs & Integrations

LRamsden
Member

Update existing property to be unique, need to fetch Deal by custom property

SOLVE

I have created a Deal custom property, `purchase_reference_id`, which I cannot seem to fetch Deals by. I suspect this is because I mistakenly did not set `hasUniqueValue` to `true`. However, it does not seem that I can update the hasUniqueValue, presumably because the property already exists, and I cannot delete and recreate the property because properties seem to only soft delete. Can somebody from HubSpot please help me rectify this?

Please note that this is a test account and so I can easily remove this property so that it is not used in any Deals - the issue is that while API requests to update the hasUniqueValue property succeed, they don't seem to actually change anything.

Screenshot 2021-05-24 at 20.37.38.pngScreenshot 2021-05-24 at 20.37.48.png

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Update existing property to be unique, need to fetch Deal by custom property

SOLVE

Hey @LRamsden ,

 

All's set here.

 

I've recreated the `purchase_reference_id` property on your portal and set the `hasUniqueValue` value to true.

 

Let me know if there are any queries on this!

View solution in original post

7 Replies 7
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Update existing property to be unique, need to fetch Deal by custom property

SOLVE

Hey @LRamsden ,

 

All's set here.

 

I've recreated the `purchase_reference_id` property on your portal and set the `hasUniqueValue` value to true.

 

Let me know if there are any queries on this!

WendyGoh
HubSpot Employee
HubSpot Employee

Update existing property to be unique, need to fetch Deal by custom property

SOLVE

Hey @LRamsden , 

 

Thanks for the confirmation!

 

On my end, I deleted the property and tried recreating it by sending the following API request:

POST https://api.hubspot.com/crm/v3/properties/deals/

 

 

 

{
  "groupName": "dealinformation",
"name": "purchase_reference_id",
  "hidden": false,
  "displayOrder": -1,
"hasUniqueValue":true,
  "label": "Purchase Reference ID",
  "type": "string",
  "fieldType": "text",
"description":"The ID that refers to the object in Zilch's systems"}

 

 

 

however, I'm seeing the following error:

 

 

{
status:"error",
message:"Field 'hasUniqueValue' cannot be modified for property 'purchase_reference_id'.",
correlationId:"fe980db6-f74d-4c35-b3f6-1283af63f11e",
propertiesErrorCode:"PROPERTY_INVALID"}

 

 

 

For this case, I've reached out to our internal team to check on it and I'll keep you posted here.

 

WendyGoh
HubSpot Employee
HubSpot Employee

Update existing property to be unique, need to fetch Deal by custom property

SOLVE

Hey @LRamsden,

 

Happy to help here 🙂 

 

To start, could you share with me the portal Id in question? When I attempt to locate deal Id 10040947267 on portal 195xxxxx, it doesn’t exist.

 

The reason I asked for the portal Id is because, I’d like to try updating the `purchase_reference_id` property’s `hasUniqueValue` to true using the Update a property endpoint. However, if you’ve already deleted the property, I’d like to try and recreate the property using the Create a property endpoint.

 

Based on your screenshots, it looks like you’re retrieving the property (as both the method are GET) and not creating it, so I’d like to see if I’m getting any error when attempting to recreate the `purchase_reference_id` property. 

 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Update existing property to be unique, need to fetch Deal by custom property

SOLVE

Hey @LRamsden,

 

Happy to help here 🙂 

 

To start, could you share with me the portal Id in question? When I attempt to locate deal Id 10040947267 on portal 195xxxxx, it doesn’t exist.

 

The reason I asked for the portal Id is because, I’d like to try updating the `purchase_reference_id` property’s `hasUniqueValue` to true using the Update a property endpoint. However, if you’ve already deleted the property, I’d like to try and recreate the property using the Create a property endpoint.

 

Based on your screenshots, it looks like you’re retrieving the property (as both the method are GET) and not creating it, so I’d like to see if I’m getting any error when attempting to recreate the `purchase_reference_id` property. 

 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Update existing property to be unique, need to fetch Deal by custom property

SOLVE

Hey @LRamsden,

 

Happy to help here 🙂 

 

To start, could you share with me the portal Id in question? When I attempt to locate deal Id 10040947267 on portal 195xxxxx, it doesn't exist.

 

The reason I asked for the portal Id is because, I'd like to try updating the `purchase_reference_id` property's `hasUniqueValue` to true using the Update a property endpoint. However, if you've already deleted the property, I'd like to try and recreate the property using the Create a property endpoint.

 

Based on your screenshots, it looks like you're retrieving the property (as both the method are GET) and not creating it, so I'd like to see if I'm getting any error when attempting to recreate the `purchase_reference_id` property. 

 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Update existing property to be unique, need to fetch Deal by custom property

SOLVE

Hey @LRamsden,

 

Happy to help here 🙂 

 

To start, could you share with me the portal Id in question? When I attempt to locate deal Id 10040947267 on portal 195xxxxx, it doesn't exist.

 

The reason I asked for the portal Id is because, I'd like to try updating the `purchase_reference_id` property's `hasUniqueValue` to true using the Update a property endpoint. However, if you've already deleted the property, I'd like to try and recreate the property using the Create a property endpoint.

 

Based on your screenshots, it looks like you're retrieving the property (as both the method are GET) and not creating it, so I'd like to see if I'm getting any error when attempting to recreate the `purchase_reference_id` property. 

 

LRamsden
Member

Update existing property to be unique, need to fetch Deal by custom property

SOLVE

Hi Wendy,

 

Thanks for looking at this.

 

The deal ID is "5342463385", the ID you were searching by is the transaction_id property

0 Upvotes