I have a workflow where the user can input their own file then select which fields they'd like to append. The analytic app asks which field in their file is the account number. The option they select is what joins the data together and dynamically queries the database. This was working perfectly until someone chose a field from their file that unknowingly had a trailing space in the column name "Column ". When they choose that field on the server, that field is trimmed or at least appears to be based on the following message:

I'm pretty certain this is the root cause because when I remove the trailing space from the column it works. Also, when I use debug in designer, this issue doesn't occur. Although I would describe this as a bug, I'm wondering if anyone has an idea for a workaround. This tool is intended for non-data users, and I don't want them to have to think too much about the details.
I'm attaching a simplified version of the workflow. Since it uses a dynamic SQL query, you won't be able to run it, but you can see the construct.