diff --git a/client/packages/lowcoder/src/comps/editorState.tsx b/client/packages/lowcoder/src/comps/editorState.tsx index 81b462201..6b40d61de 100644 --- a/client/packages/lowcoder/src/comps/editorState.tsx +++ b/client/packages/lowcoder/src/comps/editorState.tsx @@ -493,6 +493,15 @@ export class EditorState { if (name !== oldName && this.nameAndExposingInfo().hasOwnProperty(name)) { return trans("comp.nameExists", { name: name }); } + + //Check query variable name duplication + const queryComInfoList:string[] = [].concat(...(this.getQueriesComp() + .toJsonValue().map((item: any) => item.variables.variables.map((v: any) => v.key)))); + + if (name !== oldName && queryComInfoList.includes(name)) { + return trans("comp.nameExists", { name: name }); + } + return ""; }