Good question. To do this you want to search for the “new” or “existing” record.
So you need two inputs and one output. You can resolve this with a flowpart.
Step 1 - create the flowpart
The flowpart has 2 inputs: The “new” firm and the “existing” firm. These are both inputs.
Check if firm 1 is supplied → for example firm 1/created =/ empty
→ true: calculation input/Firm 1 (name: Firm)
→ false: calculation input/Firm 2 (name: Firm)
Output: Firm
Step 2 - Add these to the userflow after you created a new firm or check the details of an existing firm. Check screenshot how your flow then would look like