You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] "Pick a day" for macro ignores specified DATE variable for nested Template #2265
Describe the bug
When running a macro with "(Pick a day)", templates that have DATE set to a variable use the "(Pick a day)" result rather than the variable result.
To Reproduce
Steps to reproduce the behavior in Obsidian:
Set a global variable (or a custom script that sets a local variable) called testDate set to some date different than today.
Create a macro with a name like test
Set Add to command palette and Add to command palette (Pick a day)
Add the above custom script to set the local "testDate" variable
Add a template to the macro that uses {{DATE}} for the filename (and some blank note for the template)
Run the macro normally - the note should be created with the name of today's date
Run the macro with (Pick a day) and select a date other than what the script/global variable is set to - the note gets created with the name of the date that was picked rather than the value of the variable.
Expected behavior
When a DATE is set to a variable, it should always use that variable rather than getting overridden by the result of "(Pick a day)". For the other options (yesterday, last week, custom) I'm not sure what the obvious expected behavior would be when using "(Pick a day)". But for variables I think it makes sense to not have "(Pick a day)" override it, since rarely would the variable provided be directly based on DATE. Obsidian Debug Info (required for bug reports)
SYSTEM INFO:
Obsidian version: 1.14.4
Installer version: 1.14.4
Operating system: Windows 11 Pro 10.0.26300
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 1
Plugins enabled: 1
1: QuickAdd v2.32.1
RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
Hey @aarontcannon! Thanks for the report, and for following up on #2242. I could reproduce it, and it's fixed in #2266, which will ship in the next QuickAdd release.
"(pick a day)" set the picked day for every choice inside the macro, so your Template's A variable… setting never got read. A macro's own Which day did the same thing, even without "(pick a day)".
Now a choice inside a macro with Which day set to A variable… always uses its variable. That holds when you run the macro with "(pick a day)", and when the macro has its own Which day. You're right that the variable is rarely based on {{DATE}}, so the picked day shouldn't replace it.
Today, Ask each time, Yesterday, Last week, and Custom still take the macro's day, like before. With "(pick a day)", that's the day you picked. I kept it that way so the days don't stack: a macro set to Last week, with its templates also set to Last week, should still write last week, not two weeks ago.
I tested it in Obsidian with your setup: a script that sets testDate, a Template that uses testDate for its day with {{DATE}} as the file name, and the macro's "(pick a day)" command. Before the fix, the note was named after the picked day. After the fix, it's named after testDate, and a second Template on Today still gets the picked day.
Global variables are different. A variable… only reads variables set during the run, like the ones a script or a {{VDATE}} prompt sets. It can't read global variables, because those are text QuickAdd fills in where you write {{GLOBAL_VAR:name}}. If you point Which day at a global variable, the run stops with Date origin variable "testDate" is not set. Set it from a script step instead:
Activity
test(date): reproduce Pick a day overriding a nested variable day (#2265
fix(date): keep a nested variable day under Pick a day (#2265)
fix(date): keep a nested variable day under Pick a day (#2266)
chhoumann commentedon Oct 30, 2026
Hey @aarontcannon! Thanks for the report, and for following up on #2242. I could reproduce it, and it's fixed in #2266, which will ship in the next QuickAdd release.
"(pick a day)" set the picked day for every choice inside the macro, so your Template's A variable… setting never got read. A macro's own Which day did the same thing, even without "(pick a day)".
Now a choice inside a macro with Which day set to A variable… always uses its variable. That holds when you run the macro with "(pick a day)", and when the macro has its own Which day. You're right that the variable is rarely based on
{{DATE}}, so the picked day shouldn't replace it.Today, Ask each time, Yesterday, Last week, and Custom still take the macro's day, like before. With "(pick a day)", that's the day you picked. I kept it that way so the days don't stack: a macro set to Last week, with its templates also set to Last week, should still write last week, not two weeks ago.
I tested it in Obsidian with your setup: a script that sets
testDate, a Template that usestestDatefor its day with{{DATE}}as the file name, and the macro's "(pick a day)" command. Before the fix, the note was named after the picked day. After the fix, it's named aftertestDate, and a second Template on Today still gets the picked day.Global variables are different. A variable… only reads variables set during the run, like the ones a script or a
{{VDATE}}prompt sets. It can't read global variables, because those are text QuickAdd fills in where you write{{GLOBAL_VAR:name}}. If you point Which day at a global variable, the run stops withDate origin variable "testDate" is not set.Set it from a script step instead:Let me know if anything still acts up after you update!