Modules
Class 4: Custom Calculation
Transcript
Team, what's going on? Let's talk about, the new calculated properties and how does it, you know, compare with Salesforce, formula field. So first things first, let's talk, who gets it. So everyone with pro pro plus has this.
It's just the calculated property, the function is upgraded. Now we have the custom equations, with, you know, formulas and stuff. So this is good. If you are on pro, you'll get five properties across all objects.
So it's not like you get five, for contacts, five for companies. It's five for all the objects that you do. So just be mindful of that, when you're, building out the calculations.
When you're enterprise, you're in luck. You get, two hundred something, you have two hundred calculated properties. So that's that's really good. So So let's get into it.
To get started, label something. I'm gonna label it demo, and, I don't know, just select random group. And then calculation, build calculation. Click on advanced mode.
Now you'll get this formula builder. So, you can see this data type undefined. Now pay attention to this one. So let's go ahead and, write something.
Maybe if, so let's let's say, let's do annual revenue.
So let's say, if annual revenue is greater than, I don't know, or some value, then we'd like to say that this is, you know, an ideal company or ideal prospect.
And if not, then not ideal. You can see this data type has changed to string. But if you go to Salesforce, you obviously first go to the object manager, you select your object, and then you go to fields and relationships, and then you create a new field. And look at this, super ugly interface.
Why Salesforce? Why is it so hard? I mean, we can fix this. Software is not so bad, honestly, like, in terms of the functionality.
Some things, of course. If you click on formula and then, you get this. So first, you'll have to select the written type. Like, what is the output like you are expecting.
So you need to first need to select the written type. And then once you select the written type, you'll get, you know, your actual formula builder. So going back, so ideal, not ideal. And then let's say, let's use another function.
So you can see all the functions that are listed here.
Year, lowercase, max, month. Let's do something date related. So date, I wanna see when was the last time contact a company owner was updated. So properties, owner.
So this will like, this is now, pushing out date time. So this is the return type of the property. This is important because once your property is built out, you cannot change the data type. That's point number one.
Second is, based on the data type that you have as part of the output, then you can use it, in in other, like, calculations or other things. So it's gonna, you know, reflect like that. I still have more testing to do on this part, but this is how the data type is changing. Like, it's dynamic based on the formulas.
So let's go to, Salesforce. So demo.
Let's create one.
So you'll get this simple formula builder, and then you'll get the advanced formula builder, and you can see the functions here. So it has, like, you know, far better amount of, functions right now. Better as in more options right now. So we are still not, you know, fully there, but I built two use cases. Let me show you real quick. So contract status are fairly simple.
So if then I'm using this time between property, and then I'm using contract start date and end date. One thing, I quickly wanted wanted to share that when at the time of this recording, when I was, you know, building out the start date and end date, these are custom properties. This, formula, this time between formula was not accepting this input because a time between, needs, you know, both the date and the time. So you need to have a date time property.
And, with the UI, you cannot create a date time property. The date property that you create in the UI is a date property. Little confusing, I know. One sec.
So we are in the developer doc in HubSpot API.
So we have, these many data types. So you see date and date type. So these two are different. In in terms of display, you'll see the date, but it's a bit different.
So I can go into more details of this and how how you can build the actual date and property in another video. If you want, let me know in the comments. I'll do it. It's like it's only possible with, the API doc.
You have to, you know, actually push the HTTP post endpoint, and then, a date time property will be created for you. So just a quick call out. Otherwise, you're gonna, you know, say that it's not working. And then divide by this number.
So this is basically when you, do this time between calculation, it generates the result in milliseconds. So first, you have to convert the millisecond in days, and then, checking like if, the time between these two dates is less than sixty days, then I'm gonna mark it as ending soon or it's gonna stay live. So this is how it's gonna look. So, contract end date.
So let's try adding a contract end date.
So contract end date must be after. So I've I've added actually a a validation, so date needs to be in the future. So let's add it, you know, thirty, and then start date is, I don't know, one month, and save, and then let's go refresh. So this shows, it's live right now because it's greater than sixty days.
Let's review. So I've changed the dates and when it's, like, less than so it's ending soon. So you don't you get rid of, you know, a full fledged workflow and the maintenance and all those early timeline events that you get, for these kinds of workflows. It's gone now.
So this is one, good use case. And then the actual power, is when you unlock, you know, using, multiple ifs. So one one nested if is I think I've deleted a nested if. Yeah.
There is a nested if. So there is this if condition. If the amount is greater than this and then, less than this, so it's a okay. Okay.
Deal. If it's, if greater than this, like, ten thousand, then it's, like, great deal. And if none of those, then it's a very crappy deal. So you get the idea.
The functions that are here right now are fairly limited. I think it's, twelve, thirteen something. Not sure, but fairly less. But feel free to play around and let me know what are your use cases.
And if you wanna chat about it and nerd about it, you know, brainstorm how how we can solve some things, I'm game. Let me know. Thank you.