Help Needed: for try loop

I am trying create a component, which can try to connect to Databricks and only output the DB connection when I successfully connect to it. But I got the error message that ”Output node must not be part of a loop construct.“ How can I solve my problem?

If I put the Component Output outside the loop, then another error message “ERROR Variable Condition Loop End 7:0:2297 Loop Body wired incorrectly (Branches are not permitted to leave loops!).

WARN Component Output 7:0:2 Output node must not be part of a loop construct.

Node is part of loop body (started by Counting Loop Start #47).”