diff --git a/app/client/src/entities/Action/actionProperties.ts b/app/client/src/entities/Action/actionProperties.ts index 95f7eb21ab..f4221d0fcc 100644 --- a/app/client/src/entities/Action/actionProperties.ts +++ b/app/client/src/entities/Action/actionProperties.ts @@ -42,8 +42,7 @@ export const getBindingPathsOfAction = ( formConfig.evaluationSubstitutionType, ); } - } - if (formConfig.controlType === "ARRAY_FIELD") { + } else if (formConfig.controlType === "ARRAY_FIELD") { let actionValue = _.get(action, formConfig.configProperty); if (Array.isArray(actionValue)) { actionValue = actionValue.filter((val) => val); @@ -63,6 +62,54 @@ export const getBindingPathsOfAction = ( }); } } + } else if (formConfig.controlType === "WHERE_CLAUSE") { + const recursiveFindBindingPathsForWhereClause = ( + newConfigPath: string, + actionValue: any, + ) => { + if ( + actionValue && + actionValue.hasOwnProperty("children") && + Array.isArray(actionValue.children) + ) { + actionValue.children.forEach((value: any, index: number) => { + recursiveFindBindingPathsForWhereClause( + `${newConfigPath}.children[${index}]`, + value, + ); + }); + } else { + if (actionValue.hasOwnProperty("key")) { + bindingPaths[ + `${newConfigPath}.key` + ] = getCorrectEvaluationSubstitutionType( + formConfig.evaluationSubstitutionType, + ); + } + + if (actionValue.hasOwnProperty("value")) { + bindingPaths[ + `${newConfigPath}.value` + ] = getCorrectEvaluationSubstitutionType( + formConfig.evaluationSubstitutionType, + ); + } + } + }; + + const actionValue = _.get(action, formConfig.configProperty); + if ( + actionValue && + actionValue.hasOwnProperty("children") && + Array.isArray(actionValue.children) + ) { + actionValue.children.forEach((value: any, index: number) => { + recursiveFindBindingPathsForWhereClause( + `${configPath}.children[${index}]`, + value, + ); + }); + } } } };