Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confiforms: Can I display field name in error message triggered by validation rule?

In Confiforms I have a number of fields for which I want to apply the same validation rule(s). I don't want these permanently part of the Field Definition macro for each field, as I want to be able to turn the validation on or off based on the value of a checkbox.

I am able to do this using a 'Confiforms Rules for Field Definition' macro, with a 'Validation rule' action, and listing all the fields I want to apply it to.  

This seems to be working, and displays the error message on Save.

However, I would like the error message to include the name of the field that triggers the validation error.  (I'm OK if it displays 10 error messages if there are 10 fields that fail validation, but I would like each error message to include the name of the affected field.)

Is there a way to do this?

1 answer

1 accepted

Generally the idea is to set specific validation for each field you need and this allows you to show unique error messages specific to these validation rules

If you put the field names into the validation rule (first parameter on the macro), as comma separated list and when validation gets applied you will see these fields marked/highlighted with "red" border

This is what is possible at the moment.

Otherwise split your validation rules into different ConfiForms Field Definition Rules macros with unique validation rules and error messages

Alex

Yes, I have done that with several rules (one rule per field) ... but in this case I want to apply the same rule to a large number of fields.

I forgot about the highlighting in red, and that works fine for this case! 

(It would be a slight problem if there might be multiple validation errors that each applied to multiple fields ... as it would be unclear to the user which error message applied to which highlighted fields.  But I think I can avoid that by writing the validation rules carefully.)

Thanks again, Alex!  As always, this is a brilliant plug-in, and you support it well!

Oh, another place something like this would be useful is in a universal rule to replace one value with another.

E.g. if I want a rule that detects when a user changes a field value to Foo, and change it to Bar ... and then apply that rule to 15 different fields ... then I have to create 15 separate rules, one for each field.

Why to create 15 separate rules if can have a rule that sets multiple fields at a time?

https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-Setvalue can set multiple fields without any problem

field1=some value&field2=another value&field3=1

Alex 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Miss the Confluence demos at Team 21? Watch them here!

Phew, Atlassian Team 2021 blew by. With dozens of demos and a handful of keynotes, you may have missed some of the awesome Confluence Cloud sessions. Don't' worry, you can watch them all here or on Y...

374 views 2 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you