[SalesForce] class java.lang.String cannot be cast to class moduleapi.interaction.FlowPicklistValue

I am using a Screen Flow to handle a custom Membership form. I have found an issue where if a field marked as "required" is not filled in, and the user hits "Next" on the screen flow it results in an error that reads as follows:

class java.lang.String cannot be cast to class moduleapi.interaction.FlowPicklistValue (java.lang.String is in module java.base of loader 'bootstrap'; moduleapi.interaction.FlowPicklistValue is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2b5825fa)

The same issue arises if every field is filled in properly and the user attempts to hit "Next", then "Previous" on the next screen. I am using picklists on the page as well as other fields, but this issue arises when a non-picklist required field is left blank, so I don't understand why it's occurring.

I found a post describing a similar issue here, but it describes Dependent Picklists, which I am not using in my solution. I'm new to Salesforce development, so some help on this matter would be appreciated.

Best Answer

Not sure if this is still an issue for you, but I had the same problem recently. Same exact issue when "Next" and "Previous" buttons were pressed.

I was able to resolve it easily with checking the "manually assign variables (advanced)" checkbox (see below screenshot).

enter image description here

You do not necessarily need to enter anything into the values for the output fields (i.e. you can leave them blank), unless you need them for other reasons.

Related Topic