{"record":{"id":"b412d9ee0b990410","repo":"appsmithorg/appsmith","slug":"pe-sst-5000","errorCode":"PE-SST-5000","errorMessage":"Uh oh! This is unexpected. Did not receive any information for the binding {0}. Please contact customer support at Appsmith.","messagePattern":"Uh oh! This is unexpected\\. Did not receive any information for the binding (.+?)\\. Please contact customer support at Appsmith\\.","errorType":"error_code","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/SmartSubstitutionInterface.java","lineNumber":51,"sourceCode":"            Object... args)\n            throws AppsmithPluginException {\n\n        if (mustacheValuesInOrder != null && !mustacheValuesInOrder.isEmpty()) {\n\n            for (int i = 0; i < mustacheValuesInOrder.size(); i++) {\n                String key = mustacheValuesInOrder.get(i).getValue();\n                Optional<Param> matchingParam = evaluatedParams.stream()\n                        .filter(param -> param.getKey().trim().equals(key))\n                        .findFirst();\n\n                // If the evaluated value of the mustache binding is present, set it in the prepared statement\n                if (matchingParam.isPresent()) {\n                    String value = matchingParam.get().getValue();\n\n                    input = substituteValueInInput(\n                            i + 1, key, value, input, insertedParams, append(args, matchingParam.get()));\n                } else {\n                    throw new AppsmithPluginException(AppsmithPluginError.SMART_SUBSTITUTION_VALUE_MISSING, key);\n                }\n            }\n        }\n        return input;\n    }\n\n    // Default implementation does not do any substitution. The plugin doing intelligent substitution is responsible\n    // for overriding this function.\n    default Object substituteValueInInput(\n            int index,\n            String binding,\n            String value,\n            Object input,\n            List<Map.Entry<String, String>> insertedParams,\n            Object... args)\n            throws AppsmithPluginException {\n        return input;\n    }","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/SmartSubstitutionInterface.java#L33-L69","documentation":"Thrown by SmartSubstitutionInterface.smartSubstitutionOfBindings when a mustache binding token (from mustacheValuesInOrder) has no matching entry in evaluatedParams - i.e. for the binding key there is no param whose key, after trimming, equals the token's value. The error SMART_SUBSTITUTION_VALUE_MISSING signals that the prepared-statement substitution cannot find a value to bind.","triggerScenarios":"A query contains a mustache binding like {{ this.input }} but the evaluated params map does not contain a param with that exact key. Commonly the binding references a widget or variable that was renamed, deleted, or whose value was never computed; or whitespace differences between the binding and the param key defeat the trimmed-equality check.","commonSituations":"Renaming a widget but not updating the query binding; deleting a widget referenced in the query; binding to a path that does not exist at evaluation time; copy/pasting a query between apps where the referenced widgets differ.","solutions":["Open the query and verify every {{ binding }} references an existing widget/variable; fix or remove stale bindings.","Ensure the binding key exactly matches the param key (after trimming) - avoid trailing spaces or renamed fields.","If the value is optional, provide a default in the binding or filter the mustacheValuesInOrder list before calling smartSubstitutionOfBindings.","Re-create the binding by selecting the widget from the Appsmith suggestion list rather than typing the name."],"exampleFix":"// before - binding references a renamed widget\nSELECT * FROM users WHERE name = {{ userInput1.value }};\n\n// after - binding matches the current widget name\nSELECT * FROM users WHERE name = {{ userNameInput.value }};","handlingStrategy":"validation","validationCode":"for (MustacheBindingToken token : mustacheValuesInOrder) {\n    String key = token.getValue();\n    boolean hasMatch = evaluatedParams.stream()\n        .anyMatch(p -> p.getKey().trim().equals(key));\n    if (!hasMatch) {\n        throw new IllegalArgumentException(\"No evaluated value for binding {{ \" + key + \" }}\");\n    }\n}\n// all bindings have values; safe to call smartSubstitutionOfBindings","typeGuard":"public static boolean allBindingsResolved(\n        List<MustacheBindingToken> tokens, List<Param> params) {\n    if (tokens == null || tokens.isEmpty()) return true;\n    Set<String> keys = params.stream()\n        .map(p -> p.getKey().trim())\n        .collect(Collectors.toSet());\n    return tokens.stream().map(MustacheBindingToken::getValue).allMatch(keys::contains);\n}","tryCatchPattern":"try {\n    input = plugin.smartSubstitutionOfBindings(input, mustacheValuesInOrder, evaluatedParams, insertedParams);\n} catch (AppsmithPluginException e) {\n    if (e.getError() == AppsmithPluginError.SMART_SUBSTITUTION_VALUE_MISSING) {\n        // log and skip the missing binding, or surface to the user\n        log.warn(\"Unresolved binding, skipping substitution: {}\", e.getMessage());\n    } else {\n        throw e;\n    }\n}","preventionTips":["Verify every {{ binding }} references an existing widget before running.","Re-select bindings from the Appsmith suggestion list after renaming widgets.","Trim binding keys consistently to avoid whitespace mismatches."],"tags":["smart-substitution","mustache","binding","prepared-statement","widget-ref"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}