I’ve already searched a lot and came across these 2 topics that I tried but they didn’t work:
Change Process Variable from the external task?
https://forum.camunda.io/t/condition-expression-returns-non-boolean-result-has-class-java-lang-string-and-not-java-lang-boolean/13864[Test_SqlConnection.bpmn|attachment]