Multiple Images used as a selectors to set a value

Hello all, I’m new to, I’ve been through the initial tutorials but have a use case I could use help with. I am building an online configurator for users to select a machine and then select options for those machines. The customer wants the users to be able to select their machine based on an image they click on and not radio button options.

Through reading other articles I approached the solution this way. I have a field who’s ‘initial content’ is the state (MachineType) value of the first image when it is pressed. I’ve attached an image of what it looks like.

This solution works well but where the wheels fall off my bus is how can I have the text field’s ‘initial content’ value change based on the user selecting one of the other images?

Thanks in advance for your help.

Create a custom state called something like “selectedMachine”. Then on image click set the state to the name of the current image. Then make the text use the custom state as its source.