Dropdown menu in a table
Asked by Anders Nilsen:

Hi.

We are currently trying to create a wiki space where users are supposed to create documentation of the systems used in the company. We have a few tables and in some of the cells i want there to be a dropdown menu where there are predefined values for the users to choose from, for instance "Criticality" --\> dropdown menu with High, Medium, Low etc.. So far i've been out of luck in my search to fix this, so any help would be greatly appriciated ;)


Answers:
author: Mick Davidson
body: You can add my suggestion to a template, but I'm not sure it's what you want. I can't find a drop down list macro, but there may be a 3rd party in the Marketpalce who make one.

Slightly ugly I know, but you could have a column heading for each level and put the tick box in the heading. All a user has to do then is tick the appropriate column.

Cheers.

comments: author: Stiltsoft Support
body: Hi Mick,

As you've put it, dropdown fields can be created with the apps available on the Atlassian Marketplace.

Our [Handy Macros for Confluence](https://marketplace.atlassian.com/apps/1214971/handy-macros-for-confluence-formatting-and-interactive-ui?tab=overview&hosting=server&utm_source=atlassian-community&utm_medium=answer&utm_campaign=handy-macros-traffic-sources&utm_id=1216111&utm_content=dropdown_menu) is one of the possible solutions for this use case. You can create custom sets with multiple options and switch between them later on.


author: Stiltsoft Support
body: See the screenshot attached

![Status.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/188410iBA22FBEAB63F58C1/image-size/large?v=v2&px=999 "Status.PNG")


author: Sharon Tan
body: Hi there, adding another option that people might find helpful for what they need.

Some users take advantage of the [Status macro](https://support.atlassian.com/confluence-cloud/docs/insert-the-status-macro/) OOTB in Confluence to list different values as options, each represented by a lozenge that users can choose from when populating a page or table.

Just create a lozenge for all the values you'd like your users to use/choose from, and direct them to populate or copy and paste the right value appropriately.

It wouldn't guarantee that users can't create their own values, but it could help you direct how you'd like people to use the page.

Also seeing Marketplace apps like [Scaffolding Forms \& Templates](https://marketplace.atlassian.com/apps/190/scaffolding-forms-templates?hosting=cloud&tab=overview) or [Easy Dropdown Menu (Drop down selection)](https://marketplace.atlassian.com/apps/1216797/easy-dropdown-menu-drop-down-selection?hosting=cloud&tab=overview). You could browse [dropdown apps for Cloud](https://marketplace.atlassian.com/search?hosting=cloud&product=confluence&query=drop%20down%20menu) or [self-hosted](https://marketplace.atlassian.com/search?hosting=server&product=confluence&query=drop%20down%20menu) and see if anything is of interest.


author: Kevin Jewett
body: Would love this functionality for the cloud version

comments: author: Stiltsoft Support
body: Hello Kevin,

[Handy Macros for Confluence](https://marketplace.atlassian.com/apps/1214971/handy-macros-for-confluence-formatting-and-interactive-ui?tab=overview&hosting=cloud&utm_source=atlassian-community&utm_medium=answer&utm_campaign=handy-macros-traffic-sources&utm_id=1216111&utm_content=dropdown) brings this functionality to Cloud with its Handy Status.


author: Siddhartha Mann
body: I am so struggling right now for this drop down feature.

But yes, this kinda works but not to the desired effect.

Is someone in Atlassian listening?

comments: author: Siddhartha Mann
body: :(


author: Sarah Dosanjh
body: You asked what I was looking for? It would be great to have drop down menu and scroll bar menu as well.


author: Andrey Khaneev _StiltSoft_
body: You can use [Handy status](https://docs.stiltsoft.com/display/HMFC/How+to+use+Handy+Status+macro) macro ([Handy Macros](https://marketplace.atlassian.com/plugins/com.stiltsoft.confluence.handy.macros/server/overview) add-on) as a dropdown menu.

comments: author: Paul Craven
body: Hi Andrey, would you be able to supply a handy status macro for the cloud version?


author: Roman Kirilenko
body: Hi Paul,

Unfortunately, we have no plans for Handy Macros for Cloud at the moment. But you can vote for this [here](https://stiltsoft.customercase.com/forums/handy-macros-for-confluence/ideas/30136-handy-macros-add-support-of-confluence-cloud).

Just to clarify the reason: Cloud and Server add-ons require totally different approaches due to technical limitations on Cloud. There are not many requests to support Cloud right now (that's why we haven't planned this activity yet). But this is possible in the future.


author: Bryan Wilcutt
body: You can really nickel and dime yourself to death on Confluence. I'm working on a dropdown menu macro that'll do everything that Handy does... and will be free. Coming in the next few weeks.


author: Casey Maynard
body: Will this be available for Free in the Marketplace though? Our team would welcome a simple and affordable (free) Add-On, but we'd require it to be available via the Marketplace so that it could can track it via licenses for updates, etc.

But either way Thank You for putting in the effort to find solutions for our Atlassian community.


author: Bryan Wilcutt
body: Yes.

I've worked at too many places, running projects, that can't have something stupidly simple as a damn calendar without shelling out $10/mo for it... on top of all the other nickels you have to shell out for Confluence. In the end, you end up paying 2x or 3x more for Confluence just to make it worth using. There's a good reason why Microsoft SharePoint still exists-- as expensive as it is, it is still cheaper than confluence.

And the source code will be posted too.


author: Ann-Marie Batten
body: Is this available?


author: James M
body: Let us know Bryan if/when this does become available. We appreciate your efforts.


author: Danae Vara
body: [@Bryan Wilcutt](/t5/user/viewprofilepage/user-id/3394879) any updates on your development of a dropdown menu macro you were working on?


author: Mick Davidson
body: Anders,

I've just done this, but I'm not sure it's exactly what you're looking for. This is what I made it work:

1. Add the table.
2. Insert the Expand macro.
3. On the page in Edit mode, click on the Task List icon in the Toolbar (the one with the ticks).
4. Add three of those and label them High, Medium, Low.
5. Save the page.
6. Now Click on 'Click here to expand'.
7. Select whichever tick box is appropriate.
8. Job done. :)

I tested it by navigating away from the page and back again via several others, and when I clicking on 'Click here to expand' the tick was still there, and where I wanted it to be.

Does that do the job?

Cheers.

comments: author: Mick Davidson
body: PS, don't forget you can change the name from 'Click here to expand' to something more appropriate. :)


author: Ammar Yasir
body: But it only works in the edit mode where you can edit the options on the check boxes and not when you publish the page.


author: Negi Joon
body: Hi,

I can only do it for each cell. What I want though is to expand a whole row in a table.

How can I do that?


author: EPS Software Engineering AG
body: Maybe our App Easy Dropdown Menu could be a solution. It can be found on the Atlassian Marketplace.

Regards,  
Stephan (CEO of EPS Software Engineering AG, the vendor of the Easy Dropdown Menu)

comments: author: Casey Maynard
body: Easy Dropdown menu is easy enough to use. We have in-use on our downs. It make confluence more like forms, instead of a wiki.

Note: The multi-select option for this is does not look like a traditional 'drop-down' menu, but at least there is a multi-select option.


author: ITProcurement
body: Got a good solution from <https://community.atlassian.com/t5/Answers-Developer-Questions/Creating-a-dropdown-user-macro/qaq-p/494678>.

Need to create a new user macro like below. You can update $body.split("\\n") ) to $body.split("\</p\>") ) if html content is used.

```
## @param DropdownId:title=Unique dropdown ID|type=string|required=true|default=1|desc=If more than one dropdown in page, change this to a unique name.## @param Label:title=Label|type=string|desc=Enter dropdown label, if desired#set ( $dropdownId = "" )#set ( $dropdownId = "dropdown-" + $paramDropdownId )#set ( $label = "" )#set ( $label = $paramLabel )#set ( $toplabel = "" )#if ( $label == "" )  #set ( $toplabel = "top-label" )#end#set ( $pageId = $content.id )#set ( $options = $body.split("\n") )<form class="aui $toplabel">  <div class="field-group">    #if ( $label != "" )      <label for="$dropdownId">$label</label>    #end    <select class="select" id="$dropdownId" name="$dropdownId">    #foreach ( $option in $options )      #set ( $option = $option.trim().replaceAll('"', '' ) )        <option value="$option">$option</option>    #end    </select>  </div></form><script>AJS.toInit(function() {  var canEdit = true;    #if ( $permissionHelper.canEdit($userAccessor.getUserByName($req.remoteUser), $content) )  jQuery("#$dropdownId").change(function() {    var dropdownObject = this;    jQuery.ajax({      url: contextPath + "/rest/api/content/${pageId}/property/${dropdownId}",      success: function(dropdownData) {        dropdownData.value = jQuery(dropdownObject).val();        dropdownData.version.number += 1;        jQuery.ajax({          contentType: 'application/json',          type: 'PUT',          url: contextPath + "/rest/api/content/${pageId}/property/${dropdownId}",          data: JSON.stringify(dropdownData)        });      },      error: function(response) {        var dropdownData = {};        dropdownData.key = "$dropdownId";        dropdownData.value = jQuery(dropdownObject).val();        jQuery.ajax({          contentType: 'application/json',          type: 'POST',          url: contextPath + "/rest/api/content/${pageId}/property",          data: JSON.stringify(dropdownData)        });      }    });  });  #else    canEdit = false;  #end    jQuery.ajax({    url: contextPath + "/rest/api/content/${pageId}/property/${dropdownId}",    success: function(dropdownData) {      jQuery("#$dropdownId").val(dropdownData.value);      if (!canEdit) {        jQuery("#$dropdownId").prop( "disabled", true );      }    }  });});</script>
```


author: Zohair Reborn
body: Maybe you can use the simple HTML Drop Down list within HTML Macro:

```
<div>
 <select name="Criticality">
 <option value="high">High</option>
 <option value="medium">Medium</option>
 <option value="low">Low</option>

</select>
</div>
```

comments: author: Casey Maynard
body: How and where do you implement this within Confluence?


author: Zohair Reborn
body: EDIT the confluence page

there is a **+** sign for the Macros *OR*start typing {html so that the HTML Macro box is placed.

And paste the above code in that box


author: csjasnoch
body: This solution is nice because it is simple, but I am failing to see how the value is saved from one session to the next.

Won't each session just repopulate the drop down with the top value (i.e. "high")?


author: rohit patel
body: Hi Zohair,

I am trying to implement the drop down to filter a confluence table. This table contains of two columns 1. Page title and 2. Category.

What i want to achieve is to apply the drop down filter to the category and be able to filter based on that.

When i add the code to the confluence html macro, i get the drop down, which is great but how do i link the drop down menu options with the table?

P.S i am very new to the world of coding so please bare with me :)

Regards,

Rohit


author: Andrey Khaneev _StiltSoft_
body: Hi Rohit,

You can use [Table Filter](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=cloud&tab=overview) macro with [dropdown filter](https://docs.stiltsoft.com/display/TableFilter/Managing+Dropdown+Filters) for this purpose. See how it works on the [demo site](https://demo.stiltsoft.com/display/tblfilter/Filtering+Text+Table+Data).


author: rohit patel
body: Thanks for your suggestion Andrey. But i do not have the budget to purchase a plug in. I am looking for a work around maybe using a code?

Regards,

Rohit


author: William G
body: High, I'm having the same challenge 2 years after this thread, has anyone got any luck so far ?


author: Casey Maynard
body: Just another example of Atlassian community not providing the simplest of feature for page creation. Give the cost of their licenses, you'd think they be able to provide a faster turnaround on some of these simple features like a drop-down menu option


author: Mick Davidson
body: Yes, it's a bit of a workaround isn't it? :)


author: Anders Nilsen
body: I'll give it a try ;) Not exactly what i wanted, but it'll have to do for now so i'll give you the answer on this one ;) Thanks for the feedback :)


author: Anders Nilsen
body: (haven't tried it yet), but as it looks by your explanation i cannot do this when creating a global template? (Im using Confluence 4.2.11)

Here's an example:

h2.Application(s)

h3.\<Application Name\>

\|\|#\|\|\|Item\|\|\|Information\|\|\|Comment\|\|  
\|1\|Appliaction Name / Version:\| \| \|   
\|2\|Number of users:\| \| \|  
\|3\|Criticality:\| \| \| \<--- Here's where i want a dropdown menu where the users can put in either "High", "medium", or "low"..  
\|4\|Network:\| \| \|  
\|5\|Application type:\| \| \|  
\|6\|Vendor:\| \| \|  
\|7\|File paths:\| \| \|


Tags: select-list

table