Switch activity using string always goes down default path

Hi,

I am using CE 21.10.03

I am going through some learning videos and have created the vending state machine.

At one point you select a drink type, I am using a switch based on the drink name to allocate a drink price.

My issue is that although I have changed the switch type to string the switch always goes down the default choice (even though the selected choice is one of the options)

I included a trim on the strDrinkType value as someone with a similar issue found that was the problem (although I don’t think it is in this case as the variable doesn’t have any trailing spaces, which you can see in the locals window of the screen shot)

Attached also is the project folderVendingMachine_Test.zip (4.4 KB)

I’m sure I’m doing something very stupid but can’t see what.

Thanks,

Hi @charliefik

Just remove double quotes for Coffee in switch activity and check. like in screenshot and check

Thanks,

1 Like

@Boopathi.M

THANKS VERY MUCH!!!

You are a star! (I am an idiot!)

I doubt I’ll forget that one again, thank-you.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.