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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,252
Community Members
 
Community Events
176
Community Groups

Add limit

Edited

Hello I am creating a confiform where user can put IDs. I put comma separate to put those  IDs.But how can set a limit that user can’t put more then 5 IDs on the form?please reply 

1 answer

1 accepted

0 votes
Answer accepted

Hi @Mr Ali and welcome to this community

Are you using a text field to enter IDs? Not something like a "multi-label" field in ConfiForms, no?

If a text field then you can set up a conditional validation rule, something like this

Demo:  http://recordit.co/zjfdGrSm0b

Example storage format:

<ac:structured-macro ac:macro-id="43cb5d70-d629-40b8-9046-c3dd31f69854" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="a5e447e7-e1a8-4f0c-95e7-52e959a2bd4d" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="hideMetadata">true</ac:parameter>
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="864de13f-9e71-400b-bcf0-5531e89fa067" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">IDS</ac:parameter>
<ac:parameter ac:name="fieldLabel">Enter IDS</ac:parameter>
<ac:parameter ac:name="fieldDescription">comma separated, but not more than 5</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="ea9621a5-8c59-4d06-bc75-d2886b5f17ab" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">IDS.split(,).asCount:&gt;5</ac:parameter>
<ac:parameter ac:name="fieldName">You are not allowed to enter more than 5 IDs</ac:parameter>
<ac:parameter ac:name="action">Validation rule</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>

Hope it helps

Alex

Hi Alex,

I followed your suggested steps,but not working

I added two Macro

first one is Confiforms Form field Defination

Here I put

Field name   IDS

Field label    IDS

Field Type    Text

Field description (optional)    comma separated, but not more than 5

 

on the 2nd Confiforms Rules for Field Definition

Field name     You are not allowed to enter more than 5 IDs

Condition  IDS.split(,).asCount:&gt;5

Action to execute *   Validation rule

 

Could you please check what need to change here

The condition is 

IDS.split(,).asCount:>5

(in the storage format it gets escaped to be XML friendly) 

but in the demo I have recorded for you it is not escaped

Have you checked the screencast I have recorded for you?

Yes, I checked the recorded video, followed all the steps.But still after putting all the condition and parameter not able to limit the form

Really not sure I can help you here - provided a video, a storage format for the configuration for you to easy import...

Showed it works...

May be someone else can help better

I tired again today,its working. Thank you Alex

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events