diff --git a/src/backend/langflow/api/v1/validate.py b/src/backend/langflow/api/v1/validate.py index 362430cf8..aa3748785 100644 --- a/src/backend/langflow/api/v1/validate.py +++ b/src/backend/langflow/api/v1/validate.py @@ -74,7 +74,11 @@ def add_new_variables_to_template(input_variables, prompt_request): multiline=True, input_types=["Document", "BaseOutputParser"], ) - + if variable in prompt_request.frontend_node.template: + # Set the new field with the old value + template_field.value = prompt_request.frontend_node.template[variable][ + "value" + ] prompt_request.frontend_node.template[variable] = template_field.to_dict() # Check if variable is not already in the list before appending