Confiforms set default value in dropdown field which users may not edit

Jan
Contributor
June 27, 2019

Probably an easy one for the experts: 

I have a dropdown field with status (open, in progress, done). This field may only be edited by a small group of users. When any user adds a new dataset in the form, the status should always be "open" at first. 

I tried to realize this with Rules for Field Definition where I set 

condition = status:[empty]
action to execute = Set value 
Values to set = status=open 

But this does not work when a user is adding a dataset who is not in the specified group... 

Thanks for any help

 

1 answer

1 accepted

1 vote
Answer accepted
Jan
Contributor
June 27, 2019

Solved: This was easier than I thought, the default value is not just set by the registration control macro. 

David Pressley
Contributor
June 1, 2020

If the default value is not just (read: only) set by the registration control, what other field must be set?

Lauren Hanyok
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 18, 2020

Also curious on what else you needed to set @jan 

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2020

Hi guys, 

What are your questions specifically? I understand what Jan wanted and did, but I cannot understand your questions (from Jan's question context)

Thanks

Alex

davin
Contributor
April 8, 2021

Hey @Alex Medved _ConfiForms_ 

I just faced a similar problem. But I want to set the default value of the status dropdown based on a condition.
Lets say there is another dropdown field with options ONE and TWO, I want the Status dropdown to default to Open only if the User selects TWO in the previous dropdown. If the user selects ONE, the Status dropdown stays empty.

I tried two ways of doing this -

  • Using the "Set Values" parameter in the "Registration Controls" macro but I cant figure out how to implement a conditional statement here.
  • Using the "Set Values" action in the "Rules for Field Definition" macro but the condition seems to not work for Dropdowns. I tested the condition with a text field and it worked just fine. Is there a specific way (using IDs?) to set conditions for Dropdowns? Attaching the Status field screenshot - VMO is the status Dropdown field who's value I want to set to One based on the previous dropdown.Set Values.jpg
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2021

Of course it works for the dropdowns and for any type of field

But conditions (filters in ConfiForms) operate with internal values, same goes for "setting the values"

Is "One" is the ID of the option for your VMO dropdown or a label?

Alex

davin
Contributor
April 9, 2021

Ah, I assumed '=' meant label and ':' meant ID as the input parameter. 

Got it working. As always, thanks a ton Alex for your invaluable support.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 11, 2021

Not quite, the '=' is used when you set the values

While the ':' is used in filtering - separating field name (or expression) from field value (or expression)

 

Hope it helps

Alex

Like davin likes this
Barry Smyth
Contributor
February 9, 2023

Nope I don't understand what the solution was for this thread. Can someone be a little bit more specific.

I use the Rules for Field Definition where I set (in my case)

condition = Status:[empty]
action to execute = Set value 
Values to set = Status=Pending

Q1) Where does this field need to be placed

Q2) What else needs to be done to get it to work because I have tried and the field just stays empty.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 9, 2023

Hi @Barry Smyth and welcome to this community

This is about a ConfiForms Field Definition Rules macro with action set to "Set Value"

As any ConfiForms definition macro it should be part of ConfiForms Form Definition (inside it's macro body), as this is a configuration element related to form configuration

Just to make sure - the "Pending" is the ID value for the field you want to set? And not the label, right?

Alex

Barry Smyth
Contributor
February 10, 2023

Perfect, that answered my question and I was able to get it working. Thank you!

Barry Smyth
Contributor
March 28, 2023

I think I spoke to soon works for me, but then I have access to the restricted field.

However, for a normal user (who does not have access to the field) the field is not defaulted to anything and left blank once a new record is saved.

In other words, even though the rule is set in the correct place, because a normal user cannot edit that field the rule seems to be ignored.

So how do you default a field that is restricted to certain users when a normal user saves a form??

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 28, 2023

If a user does not have access to the field then they cannot set defaults or anything like that... otherwise what restriction is that

Barry Smyth
Contributor
March 28, 2023

Think of it as an administration section on a form. The user needs to know that their record is "Pending" but should not be able to change that field as it's restricted to Administrators only.  When the record has been validated by the administrator, the administrator will change the record to "Submitted". Kind of a maker/checker rule. 

If allowing only certain people to edit the field means for a normal user the default value of "pending" won't be set then that's no good.

I could hide the field from view, but then the user won't be able to see the status of their record either.

Not sure what the correct approach is in this situation.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 28, 2023

Consider using ConfiForms IFTTT macro to update the status field

It can be set to "bypass permissions" and is often used exactly for such scenarios

Alex

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events