• Créditos da HubSpot: Desbloqueie ferramentas poderosas para o crescimento

    Dúvidas?

Calculated fields return null values

Huntscape-Ops
Colaborador(a) | Parceiro Ouro
Colaborador(a) | Parceiro Ouro

I am trying to use a calculated field, but if one of the values is empty in the calculation, then it returns a null value.

 

([properties.imported_total] + [properties.total_donations])

 

There has to be an easy way to fix this but chatgpt is telling me to use ops hub (which is fine) and use this formula in the format data step of the workflow: {{ properties.imported_total | default(0) }} + {{ properties.total_donations | default(0) }}

 

But that causes an error in the custom code step.  Please help

0 Avaliação positiva
2 Solução aceitas
karstenkoehler
Solução
Membro do Hall da Fama | Parceiro
Membro do Hall da Fama | Parceiro

@Huntscape-Ops there's no special trick to this - just find the screenshot I shared in my earlier reply and type that exactly into the formula field, character by character 🙂

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

Exibir solução no post original

0 Avaliação positiva
karstenkoehler
Solução
Membro do Hall da Fama | Parceiro
Membro do Hall da Fama | Parceiro

@Huntscape-Ops strange - can you save this and see if it populates correctly on records? It should work, see my screenshot. If it doesn't after refreshing, I'd recommend checking with HubSpot support.

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

Exibir solução no post original

0 Avaliação positiva
11 Respostas 11
karstenkoehler
Membro do Hall da Fama | Parceiro
Membro do Hall da Fama | Parceiro

Hi @Huntscape-Ops,

 

You can solve this with an 'if' statement and the 'is known' function, both available through drop downs in the formula editor - no Operations Hub required. If the number is known, return the number, if not, return a 0. Repeat the same for the second part of the calculation and that should do the trick.

 

karstenkoehler_0-1744049647724.png

 

Best regards

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

Huntscape-Ops
Colaborador(a) | Parceiro Ouro
Colaborador(a) | Parceiro Ouro
Thank you for the quick reply but I am not advanced enough to do that. I
keep getting errors in the calculation

0 Avaliação positiva
karstenkoehler
Membro do Hall da Fama | Parceiro
Membro do Hall da Fama | Parceiro

@Huntscape-Ops can you please share a screenshot? If you type the shown formula exactly, you shouldn't get any errors.

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

0 Avaliação positiva
Huntscape-Ops
Colaborador(a) | Parceiro Ouro
Colaborador(a) | Parceiro Ouro

This is my original calculation but it puts out null value when one of the fields is empty.  

HuntscapeOps_0-1744051735037.png

I have no idea how to adapt this to "if" and "is known" as you were describing. 

 

Any help would be greatly appreciated

0 Avaliação positiva
karstenkoehler
Solução
Membro do Hall da Fama | Parceiro
Membro do Hall da Fama | Parceiro

@Huntscape-Ops there's no special trick to this - just find the screenshot I shared in my earlier reply and type that exactly into the formula field, character by character 🙂

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

0 Avaliação positiva
Huntscape-Ops
Colaborador(a) | Parceiro Ouro
Colaborador(a) | Parceiro Ouro
Wow that worked. I had 1 space off.

Thank you so much
0 Avaliação positiva
Huntscape-Ops
Colaborador(a) | Parceiro Ouro
Colaborador(a) | Parceiro Ouro

I lied.  The formula no longer has errors but I am still getting null values in the calculated field

0 Avaliação positiva
karstenkoehler
Membro do Hall da Fama | Parceiro
Membro do Hall da Fama | Parceiro

@Huntscape-Ops can you please share a screenshot and the error message? I can't help if I don't have any details.

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

0 Avaliação positiva
Huntscape-Ops
Colaborador(a) | Parceiro Ouro
Colaborador(a) | Parceiro Ouro

Does this help

 

HuntscapeOps_0-1744052623041.png

 

0 Avaliação positiva
karstenkoehler
Solução
Membro do Hall da Fama | Parceiro
Membro do Hall da Fama | Parceiro

@Huntscape-Ops strange - can you save this and see if it populates correctly on records? It should work, see my screenshot. If it doesn't after refreshing, I'd recommend checking with HubSpot support.

Karsten Köhler
HubSpot Freelancer | RevOps & CRM Consultant | Community Hall of Famer

Beratungstermin mit Karsten vereinbaren

 

Did my post help answer your query? Help the community by marking it as a solution.

0 Avaliação positiva
Huntscape-Ops
Colaborador(a) | Parceiro Ouro
Colaborador(a) | Parceiro Ouro

I refreshed the screen and put the formula back in, and it is working now.

 

Thank you so much

0 Avaliação positiva