Confiforms combine multi-user fields and loop through them

John
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 21, 2024

Hi, i've seen a similar question here before but not everything is clear to me

I have a form with 3 identical user select fields, all mandatory
I want to combine data from those 3 fields in all records into 1 list, then loop through it, find duplicates and display in an order of most duplicates to least

How could i best do that?

And if i do get the list and get the amount of duplicates, how could i display it in confiforms?

@Alex Medved _ConfiForms_ 

2 answers

0 votes
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 1, 2025

The best option for something like this would be to use a REST API, and creating a report realtime with a bit of scripting and HTML right on the Confluence page

0 votes
Humashankar VJ
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.
January 1, 2025

Hi @John 

You can create a formula field using the CONCAT function. This will merge the values from the three fields into a single list.

  • To process this list, find duplicates, and sort by frequency, you'll need to utilize custom JavaScript.
  • To achieve this, create a new formula field and use a JavaScript code that splits the combined user list into an array, counts the occurrences of each user, sorts the users by their frequency, and returns a formatted string with users and their counts.
  • Once you've set up this JavaScript formula field, you can display the results in ConfiForms using the ConfiForms Table View macro. Simply set up a column to show the result of your JavaScript formula field.

If you want to display this information across all records, you may need to use the ConfiForms Aggregation macro to combine results from multiple entries.

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events