Currently, if you want to add 1 date to a complex query at runtime, you'll probably have to make 2+ runtime parameters, so you'll get prompted for 2+ values at runtime, and you'll just have to remember that they need to be identical. What if we had a way of tagging a runtime parameter, so that you only got asked for it 1 time? That could improve UX and reduce human error.
I'm thinking that we could add an optional 2nd pipe (ie |) which lets you link runtime parameters together. Someone manually writing it could just do something like <<Start date|date|sdate123>> and use that same runtime parameter a couple of times in the query. With the "Insert runtime parameter" button, we might be able to do something clever in terms of auto-generating that linkage. Providing the friendly labels in a dropdown list, and just autogenerating the linking/tag value. -- I don't have a real plan for this, but it's just something that popped into my head while I was helping someone with a report involving runtime parameters for 1 date that has to be applied across different subqueries. I know we have "Runtime Variables" but those are actually MySQL/MariaDB session variables, and they can be problematic. Since they live beyond the life of that SQL query, it's always possible that they'll get re-used in a different SQL query. Or - as noted on the wiki - they can sometimes be optimized away. I've seen too many problems with these to really advocate for them for production data reports.
Technically, I guess we could group them by the friendly label as well, but that would be a big behaviour change from what people are used to, so I'm not so sure about that. I suppose we could always have a system preference for it with a checkbox that lets you group together parameters. Not sure. Just putting some ideas out there.
Hi David, this already works if you use the same label. Koha will only show the input once, but will use the value for every placeholder that has the same "name".
I hope I am not misunderstanding, but say you have something like: WHERE date_due = <<Date|date>> and issue_date between <<Date|date>> You will only be prompted for Date once.
(In reply to Katrin Fischer from comment #3) > Hi David, this already works if you use the same label. Koha will only show > the input once, but will use the value for every placeholder that has the > same "name". (In reply to Katrin Fischer from comment #4) > I hope I am not misunderstanding, but say you have something like: > > WHERE > date_due = <<Date|date>> > and issue_date between <<Date|date>> > > You will only be prompted for Date once. Thanks for that! I should've double-checked rather than relying on what appears to be a very old memory... Looking at the SQL Reports Library, it indicates that the runtime parameters work as you've described since 18.05. I think I'll update the wiki to make that note much more visible.