diff --git a/nuxt4-app/app/components/metabase/MetabaseCardDisplay.vue b/nuxt4-app/app/components/metabase/MetabaseCardDisplay.vue index ca0e54d..6400172 100644 --- a/nuxt4-app/app/components/metabase/MetabaseCardDisplay.vue +++ b/nuxt4-app/app/components/metabase/MetabaseCardDisplay.vue @@ -342,11 +342,22 @@ async function executeQuery() { paramValue = parameterValues.value[tagName] || '' } - parameters.push({ - type: paramType, - target: ['variable', ['template-tag', tagName]], - value: paramValue - }) + // Only add parameter if: + // 1. It's required, OR + // 2. It has a non-empty value (not null, not empty string, not empty array) + const isRequired = config.required === true + const hasValue = paramValue !== null && + paramValue !== '' && + paramValue !== undefined && + (!Array.isArray(paramValue) || paramValue.length > 0) + + if (isRequired || hasValue) { + parameters.push({ + type: paramType, + target: ['variable', ['template-tag', tagName]], + value: paramValue + }) + } } const result = await $fetch(`/api/metabase/cards/${props.card.id}/query`, {