Hello Everyone.
I have a made a custom Copilot that asks the user for their email address. That is then stored. I want to pass that variable to a Power Automate flow that reads a spreadsheet, does something if the email address from the custom Copilot is in the spreadsheet and then feeds the output back to Copilot Studio.
Here is what I have so far.
The flow runs from Copilot and lists all rows present in a table.
The table looks like this
It has an Apply to Each.

It has a condition that checks if the input from Copilot matches the Email column.
The issue here now is what do I put under the True section?
If I put the Respond to Copilot node, it gives the error below when I try to publish it:
Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'InvalidWorkflowRunAction' and message 'The workflow run action 'Respond_to_Copilot' has type 'Response' that could not be nested under an action of type 'foreach'.'."}}".
So, if I move Respond to Copilot, like below, out of the ForEach scope I can no longer access any variables from the spreadsheet.

So, if I then try to add the variables back, it creates a ForEach again and the error comes back, and I cannot save.

How can I solve this?
The flow should work like this:
1 - Take in the user_email input from the Copilot I made
2 - Read through all rows in my Excel spreadsheet
3 - Check if the user_email input is in the Email column of the spreadsheet
4 - If yes, get the DB_Name and Permissions from the spreadsheet that match it and covert those variables to String to give back to Copilot Studio,
5 - Send those String variables back to the copilot through the outputs of the Respond to Copilot node.
Many thanks.