- Issue created by @ikam
- 🇩🇪Germany jurgenhaas Gottmadingen
This is not really nice to review a problem to open 5 screenshots trying to make sense of it. If you want someone to review a problematic ECA model, you should create the most simple one that reproduces the problem, export that into an archive and upload that.
But from reading through your steps to reproduce, the steps 5-7 don't make any sense. The action plugin to remove an item from a list work with a token that holds a list. You're trying to change a read-only token that gives you access to a form value. You may want to go to the ECA Guide and see the token chapter, which explains that tokens are read only, if they are provided by the system. Only tokens that you created in ECA can be modified.
Hi Jurgen - sorry for the confusion. I have exported the ECA model and uploaded here. The model works for a list of items that is presented as checkboxes (i.e. unlimited selection). The model does not work for a list of items presented as radio buttons (limited to 1 selection).
- 🇩🇪Germany jurgenhaas Gottmadingen
Ah, you're using the token
form:values:field_colour_select
as the list to be modified, that's not supposed to be working at all. That list gets modified by the eca_list_remove action, but it's not passed back to the form definition.You should instead read the list of available options with the Form field: get options action, modify that list, and then set the options back with the Form field: set options action. Having said that, I'm not sure if this can be done in the after build event, or if it shouldn't be done in the form build event. You may have to experiment with that.
Hi Jurgen - I got it to work per your suggestion. I have to use the Build Form event, then used Form Field: Get Options action to get the current list of colors. Using the List: Remove Item action, I was able to removed the 'N/A' option from the list of colors. I then used Form Field: Set Options to set the new list back to the form. Also, now I understand why using List: Remove Item the way I did originally is incorrectly, and I now understand the intended/correct usage of List: Remove Item. Thank you so much for your help!!
I've attached my updated model for anyone interested.