Variable Fields Reorganising after save (Native Query)

Hey guys,

I’m currently trying to save a native query that has 10 optional filters but every time I save they seem to switch the order to a random display order which is quite frustrating from a usability perspective.

Example Query:

select *
from table
where column_1 = 0
[[and condition1 = {{condition1}}]]
[[and condition10 = {{condition10}}]]
order by date desc
limit 1000

I configure it all in order but then when i hit save, all the field widgets display in the following order.

2, 6, 1, 7, 5, 3 , 4, 9, 8, 10

This is rather annoying as I’m trying to have them display in the order that the columns are displayed to make it easy to understand without explanation.

Is there a work around or setting I need to change to fix this?

1 Like

Which version of Metabase are you using? I remember this being an issue but that we shipped a fix for it a while ago. Incidentally, the next version of Metabase will also include the ability to click and drag to reorder filters on SQL questions and dashboards. :+1:

1 Like

Currently using version v0.30.4

and that’s good to hear about the filters. That will make things much more versatile.

I am using the v0.31.2 and still has this problem.
It is bothering me a lot.
Do you solve this problem?

1 Like

I am using the v0.31.2 and the drag and drop function doesn’t work.
In question view, I cannot drag and drop.
In dashboard view, I can drag and drop but it works not properly.
Do you fix this problem already?

What browser and operating system are you using?

windows 10 + chrome

When I drag in Firefox 64 (and Chromium 71), then it looks like it works, but when I release the mouse, I’m getting this error:

Uncaught TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at app-main.bundle.js?78262faa1c529a733077:5
    at n.updateIn (vendor.bundle.js?78262faa1c529a733077:12)
    at t.value (app-main.bundle.js?78262faa1c529a733077:5)
    at n.setParameterIndex (app-main.bundle.js?78262faa1c529a733077:5)
    at r.handleSortEnd (app-main.bundle.js?78262faa1c529a733077:5)
    at e.handleSortEnd (vendor.bundle.js?78262faa1c529a733077:189)


Can confirm. Metabase 31.1, OS X (whatever the current prod release of Mojave is), any browser (Firefox, Chrome, Safari, Opera). This affects specifically variable input ordering within questions. It looks like they’ve inherited the UI assets indicative of drag & drop ability, but the actual changes to the question editor code necessary to make the “drop” reordering work have not been implemented.

EDIT: The old functionality of deleting all references to a variable, then re-entering it so that it appears last in the list does still work, but boy that can get tedious :slight_smile:

Hi @dodongo
I forgot to post a link to the bug report, which was created almost a month ago - sorry.
Go and upvote by clicking the :+1: on the first post:

Oh, great! Done.

Any news on this? I have been haunted by this nightmare for a long time…

1 Like

Any news on this? Linux Manjaro metabse v0.37.1., november 2020.

Upvote by clicking :+1: on the first post: