____Counting
I have a multi-user field I need to the "length" of (the number of users)- field name "multiuser".
I've tried multiuser.asLength, asCount, AsSize, asArray.asLength, [entry.multiuser.asLength], [entry.multiuser.asArray.asLength, asArrayMultiUserPicker.asLength, etc etc.
____Removing
I also want an action button that allows users to freely remove themselves from the multiuser field.
I've tried the following according to: Virtual functions - Vertuna WIKI - ConfiForms
multiuser=[entry.multiuser].remove(dthomas)
multiuser=[entry.multiuser.remove(dthomas)]
Simple example, hope it helps
Form configuration and the CardView as an example
Config for action button with action to perform set to
multiuser=[entry.multiuser.remove([entry._user]).asList]
Configuration to get number of multi-users in a field
Complete configuration
<ac:structured-macro ac:macro-id="acea6f74-e9e8-4ffb-b5d6-4907d521be72" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="5502bbd7-50ce-45a3-8d87-7b03696cd06f" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="32b58ba7-2149-49c8-9914-d9678271b277" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">multiuser</ac:parameter>
<ac:parameter ac:name="fieldLabel">Multi user</ac:parameter>
<ac:parameter ac:name="type">multiuser</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="b9cc945b-203f-481f-919c-92697be42206" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">removeme</ac:parameter>
<ac:parameter ac:name="fieldLabel">Remove me</ac:parameter>
<ac:parameter ac:name="extras">multiuser=[entry.multiuser.remove([entry._user]).asList]</ac:parameter>
<ac:parameter ac:name="type">action_button</ac:parameter>
<ac:parameter ac:name="separator">OK, removed</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="04122f97-a5a2-4d39-adf6-8a5c4a6401e3" ac:name="confiform-card" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="6a06b0ce-26fa-4983-97a5-26c9d1532853" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">multiuser</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="2c7c1d4e-22ff-420c-a790-4bdb65996b83" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">multiuser.asCount</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="4fce2d4c-1bf1-4f2e-867c-93f4056bdc70" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">removeme</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
Alex
Perfect. I could have sworn I'd tried multiuser.asCount, but perhaps not . . .
Thank you, Alex!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.