CRM

GBulleri
Participant

MAX value of a contact information custom property

SOLVE

Hello,

I am a newbie.

 

I have a custom property  "ID" of contact information group filled with  an integer from an external source.

How to calculate the MAX of ID?

 

When I create a custom property  MAX_ID type  calculation   in the  group list Contact Information group is missing (I see company,deal ect) so I cannot select ID because is missing

 

An alternative is to get the first 5  contacts  in descending order, so the ID of the first contact is the max  ... but I don't know to get contacts in descending order.....

 

Any glue?

Thank You very Much

 

0 Upvotes
1 Accepted solution
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

MAX value of a contact information custom property

SOLVE

@GBulleri ,

Hope that I am interpretting this correctly, if you want to sort your contacts by this property,  I would suggest employing the CRM search endpoint

You could send a post request with a filter polling if your custom property has a value in each record.  You would then apply the sort rule sort by that property to the request as well.  In the end, the post request json body would look something like this assuming that MAX_ID is the internal name of the property

{
    "filters": [
        {
            "propertyName": "MAX_ID",
            "operator": "HAS PROPERTY"
        }
    ],
    "sorts": [
        {
            "propertyName": "MAX_ID",
            "direction": "DESCENDING"
        }
    ]
}

 

View solution in original post

4 Replies 4
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

MAX value of a contact information custom property

SOLVE

@GBulleri ,

Hope that I am interpretting this correctly, if you want to sort your contacts by this property,  I would suggest employing the CRM search endpoint

You could send a post request with a filter polling if your custom property has a value in each record.  You would then apply the sort rule sort by that property to the request as well.  In the end, the post request json body would look something like this assuming that MAX_ID is the internal name of the property

{
    "filters": [
        {
            "propertyName": "MAX_ID",
            "operator": "HAS PROPERTY"
        }
    ],
    "sorts": [
        {
            "propertyName": "MAX_ID",
            "direction": "DESCENDING"
        }
    ]
}

 

MiaSrebrnjak
Community Manager
Community Manager

MAX value of a contact information custom property

SOLVE

Hi @GBulleri,

 

Thank you for reaching out to the Community!

If I understood correctly, you have created a custom property, where you wish to save an external contact ID.

If you don't have any filters in place, you should be able to see the property under Settings > Data managememt > Properties

Screenshot 2021-11-08 at 14.42.53.png

Please make sure that you've selected Contact properties in the object picker above. 

If you're not able to see this section, please make sure you have the right user permissions to edit settings. Additionally, please try to access this area in a different browser (preferably Google Chrome or Mozilla Firefox). 

 

If your custom property type is a Number field, you should be able to arrange the contacts in a descending order by clicking on the arrow next to the property in your contact overview: 

Screenshot 2021-11-08 at 14.51.36.png

 

I hope this helps!

 

Cheers
Mia, Community Team


Wusstest du, dass es auch eine DACH-Community gibt?
Nimm an regionalen Unterhaltungen teil, indem du deine Spracheinstellungen änderst


Did you know that the Community is available in other languages?
Join regional conversations by
changing your language settings

GBulleri
Participant

MAX value of a contact information custom property

SOLVE

Hi,

thank you for your answer...

but I am working with the REST API not with GUI so ..how to select by REST API the max value of a numeric custom property?  in  pseudo  SQL :  select  max (numeric_custom_property) from contacts?

as alternative I tried to do this but is not working:

I added a custom property to company object (crm_max_id)

In the contact object I added a calculated field   so that

crm_max_id is the MAX of a custom property of contacts

 

It is not working: crm_max _id is not updated

 

Regards

 

 

 

 

 

 

 

0 Upvotes
MiaSrebrnjak
Community Manager
Community Manager

MAX value of a contact information custom property

SOLVE

Hi @GBulleri,

 

Got it, thank you for the additional information! 

I unfortunately don't have enough experience with the REST API to be able to help here, but I wanted to tag in a couple of subject matter experts to see if they can share their expertise: 

hi @himanshurauthan@Gonzalo@Bryantworks, do you maybe have any tips for @GBulleri?

 

Thanks!

 

Cheers
Mia, Community Team  


Wusstest du, dass es auch eine DACH-Community gibt?
Nimm an regionalen Unterhaltungen teil, indem du deine Spracheinstellungen änderst


Did you know that the Community is available in other languages?
Join regional conversations by
changing your language settings