Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I write the validation rule for ensuring 2 fields match?

Bill Mills July 27, 2022

I have 4 fields (numeric):

  • TotalBudget
  • subVendorBudget
  • subTranslationBudget
  • subOtherBudget

Logically, the 3 sub fields should total the TotalBudget fields (but not automactially calculate).  

I have a 5th field (formula) called SummedBudget with this calculation and it works as desired:

("[entry.subVendorBudget]")+("[entry.subTranslationBudget]")+("[entry.subOtherBudget]")

 

Now I'm trying to create a validation rule to ensure TotalBudget equals SummedBudget but the validation error occurs even when they match, using these parameters:

Field name (or regular expression): TotalBudget

Condition: [entry.fldTotalBudget]:[entry.fldSummedBudget]

Action to execute *:  Validation rule

Execute only on user action: unchecked

Validation rule: blank

 

Please help!!

Thanks,

Bill

 

2 answers

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 27, 2022

Hi @Bill Mills 

The condition should be something like

fldTotalBudget:[entry.fldSummedBudget]

And you should specify "Message to show..." parameter in your validation rule (nothing else is necessary)

Alex

Bill Mills July 29, 2022

Hi @Alex Medved _ConfiForms_  thanks I've tried this but have the same issue.   If I don't inlclude ! at the beginning of the condition it accepts all entries even if they don't equal.  If I do include ! it won't accept any entries even when they do equal.  

Could this be due to fldSummedBudget is a formula field type and fldTotalBudget is numeric?

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 29, 2022

Could be (I have not had a chance to verify this myself yet), as the value for the formula field gets recalculated only on form submit

Not in UI (form view)

Alex

Bill Mills July 29, 2022

Thanks Alex, that answer actually helped me figure it out.   I changed the validation condition to:   !fldTotalBudget:(fldVendorBudget+fldTranslationBudget+fldOtherBudget) and it works. 

 

Thanks for your help!

0 votes
Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 27, 2022

Hi @Bill Mills 

 

What is the validator you are using, what app does it come from ?

 

Regards

Bill Mills July 27, 2022

Hello, the numeric fields are on a confluence form and completed by the user.  Sorry I'm not sure what you mean by validator; I'm a low intermediate user at best.  

Thanks!

Florian Bonniec
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 27, 2022

My bad had JIRA in mind due to the field and validator thing.

 

WHat do you use for form in Confluence ? It does not support forms without app, are you using Confiform ?

 

https://marketplace.atlassian.com/apps/1211860/confiforms-data-forms-workflows?tab=overview&hosting=datacenter

Bill Mills July 29, 2022

No worries.  Yes using confiforms.  I've tried using 

fldTotalBudget:[entry.fldSummedBudget]

as suggested by Alex with no luck.  :(   

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events