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

Confiforms how to count only the value of one field without distinct rows

Lisbon Cruz April 20, 2023

I have a confiform that registers shout out to someone in our department for demonstrating good values. I want to be able to show how many shout outs each receiver ("Toss a Token to" field) gets (which is a user field). I put the tableview in tableview table merger macro. I tried using count on Tokens Receive field, but this shows value of 1 because the entire row is not distinct. The one with the value of 2 in the screenshot is because the data in the row is exactly the same. I want to be able to show how many each token receiver gets despite who submits the shout out for them and even if it's a different value from the other field. In other words, I just want to be able to get a count of the "Toss a Token to" field. Below code is an example:

confiforms_value.PNG

<p class="auto-cursor-target">
<br/>
</p>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="3a79f8a2-0595-41ec-b2f0-8c8662cfd70d" ac:name="section" ac:schema-version="1">
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="e10ad741-0424-46a5-b529-a30596ed2b29" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="overrideSaveButtonLabel">Save Request</ac:parameter>
<ac:parameter ac:name="formName">TossTokenFormDev</ac:parameter>
<ac:parameter ac:name="overrideCloseButtonLabel">Cancel</ac:parameter>
<ac:parameter ac:name="registrationButtonLabel">Click here</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:parameter ac:name="regControlLayout">true</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="edd3a23e-e994-437a-9cd3-b98ae7cee86f" ac:name="div" ac:schema-version="1">
<ac:parameter ac:name="id">hubmargin</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="7ac8937e-1c63-46fd-817d-33c1132987eb" ac:name="confiform-table-merger" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="178308f3-732d-437e-b2e3-67579f46f7d7" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">TossTokenFormDev</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="2dc5806e-b92b-40e4-a9d5-a7bec0dc7817" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">submitter</ac:parameter>
<ac:parameter ac:name="withLabel">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="4b72955e-6149-4b50-81ae-51d3c644d14e" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">receiver</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="85ae7865-7568-4ccd-a4d3-c3ce3531ad78" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">branch</ac:parameter>
<ac:parameter ac:name="withLabel">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="6318391f-c4fd-4c00-ad57-bc2774ccfa59" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">occurrencedate</ac:parameter>
<ac:parameter ac:name="withLabel">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="2d9e52ab-9db1-41c0-8ff7-fefc2b8dc460" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">valuedemo</ac:parameter>
<ac:parameter ac:name="withLabel">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="2e98811a-e9ff-434a-b4da-9c5e402e6efa" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">description</ac:parameter>
<ac:parameter ac:name="withLabel">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="23091338-f641-4520-80f2-9324d0bbf5dd" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">Tokens Received:([count])</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="233ed44a-d579-4bd5-8c77-34ec4f546588" ac:name="section" ac:schema-version="1">
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="02adbc75-795d-45db-9f54-96e5d5e070dc" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="additionalFormAdmins">CON-Administrators</ac:parameter>
<ac:parameter ac:name="formName">TossTokenFormDev</ac:parameter>
<ac:parameter ac:name="allowReads">true</ac:parameter>
<ac:parameter ac:name="registrationFormTitle">Toss a Token</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="cff17a14-148f-4f08-80d3-8c906f78d75d" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">submitter</ac:parameter>
<ac:parameter ac:name="fieldLabel">Submitter</ac:parameter>
<ac:parameter ac:name="values">false[]</ac:parameter>
<ac:parameter ac:name="fieldDescription">What is your name? Begin typing your name or user ID</ac:parameter>
<ac:parameter ac:name="type">user</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="cf8ec1c8-5d37-4ace-a650-26a3a2628ced" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">receiver</ac:parameter>
<ac:parameter ac:name="fieldLabel">Toss a Token to</ac:parameter>
<ac:parameter ac:name="values">false[]</ac:parameter>
<ac:parameter ac:name="fieldDescription">Who would you like to nominate?</ac:parameter>
<ac:parameter ac:name="type">user</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="8ff0203f-af91-40c4-a896-4100c9379f97" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">branch</ac:parameter>
<ac:parameter ac:name="fieldLabel">Branch</ac:parameter>
<ac:parameter ac:name="values">[818743392|branchdev|branchdev|true||]</ac:parameter>
<ac:parameter ac:name="type">smartselect</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="59fbce86-a7ab-47ba-9ed7-df899e151945" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">occurrencedate</ac:parameter>
<ac:parameter ac:name="fieldLabel">Occurrence Date</ac:parameter>
<ac:parameter ac:name="extras">MM/dd/yy</ac:parameter>
<ac:parameter ac:name="fieldDescription">When did this noteworthy event, observation, or accomplishment occur? *Note: if the event, success, or sustained performance occurred on more than one day, please annotate the time-period below. It is acceptable to nominate someone for going the extra mile to help an individual or group.</ac:parameter>
<ac:parameter ac:name="type">date</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="a8713d93-6fb1-4644-a391-c675ec0d7fb3" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">valuedemo</ac:parameter>
<ac:parameter ac:name="fieldLabel">Value Demonstrated</ac:parameter>
<ac:parameter ac:name="values">[818743392|valuedemodev|valuedemodev|true||]</ac:parameter>
<ac:parameter ac:name="type">smartselect</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="87cb5bab-be07-431f-b7d9-fac20f5f960f" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">description</ac:parameter>
<ac:parameter ac:name="fieldLabel">Description</ac:parameter>
<ac:parameter ac:name="fieldDescription">Describe in 2-3 sentences your nominee’s noteworthy event, accomplishment, observation of goodwill, or sustained performance of excellence. If external to C2E2, please include Department or Code.</ac:parameter>
<ac:parameter ac:name="type">textarea</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="4901f8f3-b957-499e-9d97-7273249aaf57" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="additionalFormAdmins">CON-Administrators</ac:parameter>
<ac:parameter ac:name="formName">branchdev</ac:parameter>
<ac:parameter ac:name="registrationFormTitle">Branch</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="b031d6c0-87f0-4068-94d5-3254986624d1" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">branchdev</ac:parameter>
<ac:parameter ac:name="fieldLabel">Branch</ac:parameter>
<ac:parameter ac:name="values">[0|null|null|true||]</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="4c3c26e7-03cd-4656-8fea-8bf70d2f9518" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="restrictions">CON-Administrators</ac:parameter>
<ac:parameter ac:name="registrationButtonLabel">Register a Branch</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="5844dc96-bf05-490a-a4e2-530b56892624" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="additionalFormAdmins">CON-Administrators</ac:parameter>
<ac:parameter ac:name="formName">valuedemodev</ac:parameter>
<ac:parameter ac:name="registrationFormTitle">Value Demonstrated</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="cc986573-b239-4895-9169-be790fabb2f4" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">valuedemodev</ac:parameter>
<ac:parameter ac:name="fieldLabel">Value Demonstrated</ac:parameter>
<ac:parameter ac:name="values">[0|null|null|true||]</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="24347c9c-cc0c-4eef-a210-48e2caf0a302" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="restrictions">CON-Administrators</ac:parameter>
<ac:parameter ac:name="registrationButtonLabel">Register a Value Demo</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<p class="auto-cursor-target">
<br/>
</p>
<p class="auto-cursor-target">
<br/>
</p>
<p class="auto-cursor-target">
<br/>
</p>

 

1 comment

Comment

Log in or Sign up to comment
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 20, 2023

Hi @Lisbon Cruz 

You are trying to merge the data and count the uniques... I understand that a "unique" is the value in the field "reciever"

Just leave 2 ConfiForms Field macros inside the TableViewMerger

with a field name

  • receiver
  • with your count expression

This way it will group and aggregate by the values in the receiver field

Alex

Lisbon Cruz April 20, 2023

Yes that would work but I need to be able to show the other fields. If I only leave the receiver and the count expression field, the other ones won't show up in a table.

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 20, 2023

Yes, that is right... but think of this a bit more - if you add a submitter (for example, from you screenshot).. then how to show the count? for submitter and receiver "pair"? Just 2 rows?

Lisbon Cruz April 20, 2023

let's say I am the receiver, I received 3 shout outs. but there are 3 different submitters. So in total, I have three shout outs (or tokens as we call it). I want to be able to show the count expression field as 3 for every row of the shout out that I get. Does that make sense?

Attached is the screenshot of what I want to show. confiforms_value.PNG

Lisbon Cruz April 20, 2023

In SQL, this is possible by doing a group by and partition. I wonder if there is such a thing in confiforms?

Lisbon Cruz April 20, 2023

I saw this virtual function in the documentation and was wondering if this is what I need. I tried to use it but I get an error.

count.PNG

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 20, 2023

That could be an option for you to use to create a table you want, right

You dont need a TableView Merger

And the expression would be something like

id.queryCount(TossTokenFormDev:@self;receiver:[entry.receiver])

Alex

Like Lisbon Cruz likes this
Lisbon Cruz April 20, 2023

That worked! However, the field name is id. I used this before but this is the expression I put because I wanted to give that field a name:

Token Received:(id.queryCount(TossTokenFormDev:@self;receiver:[entry.receiver]))

when I only needed to put id.queryCount(TossTokenFormDev:@self;receiver:[entry.receiver]) and used the "Override label name to use for this field" setting to set the name of the field to whatever I want. Awesome thank you!

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 20, 2023

Indeed, the “Override label name to use for this field” is the way to go

Lisbon Cruz April 20, 2023

How do you make something as accepted solution? This is my first post since I can usually find the answers to my questions so I am not sure how to do things

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 20, 2023
Lisbon Cruz April 20, 2023

Wierd. I don't see the Accept answer button. Maybe because I started a discussion instead of asking a question.

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 20, 2023

Maybe... but no worries, next time you know what to do :-)

TAGS
AUG Leaders

Atlassian Community Events