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

Restrict field vidibility

MAX L April 25, 2023

Hi

It is possible to use entry.field in restrict view or édit option for one user or group but I need to restrict view/édit for liste of users or groups. How Can I use restrict view/édit field option dynamicaly ? In other words how Can I use another Form to set users and groups  rectrict view/édit in a second form ?

Thx

1 answer

0 votes
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.
April 25, 2023

Hi @MAX L and welcome to Atlassian community

Yes, you can restrict edit/visibility dynamically and that is by referring to another field or fields in the mentioned parameters via [entry.field_name] notations

However, the field value should be accessible to the form - probably connected to another form via the smart field

Alex

MAX L April 25, 2023

Yes but it seems work only when entry.field used in parameters has one user or group value not when it has list of user or liste of group

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.
April 25, 2023

The field expects a comma separated list of values and supports multiple

What do you provide/set?

MAX L April 25, 2023

I provide list with comma separator but it take only first value.... I dont know how to fix that

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.
April 25, 2023

Do you mind sharing your configuration or providing an example what does not work for you? 

Otherwise I dont know how to help you...

MAX L April 26, 2023

Ok

So, I have 2 forms : Form1 to set users/groups and form2 who have restrected field

Form1 : field1 use to select row, field2 group or user multisect and field3 text

Form2 : field1 which have Form1:field3 as restricted view parameters.

Form1: field3 IS used to convert Form1:field2 values in list comma separated 

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.
April 26, 2023

Not sure I get that, but here is an example what I was trying to explain in my first comment

https://recordit.co/TKqp8GcNAM

Alex

MAX L April 26, 2023

Hi

Your example is similar as I expect but in my case it works with only one user or group in field3. If I have field3 with values "userA, userB" or "groupA, groupB" it doesnt work :(

Its liké if field restriction view parameter  used only first value (userA or group A ,instead userA,userB or groupA, groupB 

To explain what I would do, its to have a Form to set user and/or group that have rights to view some fields and use it in a product form in which some fields Can bé read or not based on first form datas... 

Rightform : colorfield, users, groups

For each color correspond liste of users or liste of groups

Productform: colorfield, adresse, phone

Phone must bé visible only for users or groups with thé right color in colorfield

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.
April 26, 2023

It works for single or multiple groups, no problem

Here is the configuration of my example, you can try importing it and seeing yourself

<ac:structured-macro ac:macro-id="ddd76577-27e7-4217-b17a-983136aa70e9" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">Form1</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="549bf5f8-2f3c-452c-805b-4c4333707985" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">text</ac:parameter>
<ac:parameter ac:name="fieldLabel">Restrictions group description</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="c3f1d9b8-73b1-455a-a06d-84e05a3421f5" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">restrictions</ac:parameter>
<ac:parameter ac:name="fieldLabel">Restrictions</ac:parameter>
<ac:parameter ac:name="type">securitygroupmulti</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="802a8b31-516a-439a-a519-38549373f27e" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="7dc8e940-c237-4826-82dc-3879db17ebfa" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">Form2</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="aa8db73c-5deb-448d-98c4-716c41960c72" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="editRestrictions">[entry.restrictedBy.restrictions.asList]</ac:parameter>
<ac:parameter ac:name="fieldName">field1</ac:parameter>
<ac:parameter ac:name="fieldLabel">Field 1</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="e581600b-ab24-40ac-9857-80aeba339887" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">restrictedBy</ac:parameter>
<ac:parameter ac:name="fieldLabel">RetsrictedBy</ac:parameter>
<ac:parameter ac:name="values">[136642868|Form1|text|true||]</ac:parameter>
<ac:parameter ac:name="type">smartselect</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="161ee5b3-702f-4498-a8a7-b22ab34ddd2a" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>

You will need to change the "restrictedBy" field to point at the Form1 in your page -> reconfiguring the smart field

Alex 

MAX L April 26, 2023

Thanks a lot I will try this.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events