How to iterate through fields - how to turn off token support?
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3565516. --> Reported by: [rex.barkdoll](https://www.drupal.org/user/1808716) Related to !583 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>You can get a fuller picture of what I'm trying to do on my <a href="https://www.drupal.org/project/eca/issues/3565511">other issue</a>, but this is a separate concern. I'd still recommend scanning/answering that one first before answering this one.</p> <p>I'd like to add multiple entries to a Entity Reference Field that is using the Autocomplete widget/format. The other issue is where I'm hoping to get the best ECA-supported answer, but I also tried using the <a href="https://www.drupal.org/project/unlimited_field_settings">unlimited_field_settings</a> module, and it does let me load the /node/add page with multiple skills fields showing for the entity reference field (ie, the page loads and shows 10 rows or however many you set)<br> Thus the page will have entity reference fields with the names: field_related_skills[0][target_id], field_related_skills[1][target_id], field_related_skills[2][target_id], etc.</p> <p>When I'm iterating through an ECA loop, I can't seem to be able to use a token to put in the field name in the Form field: set value task so that as I'm looping through a list, it's updating the field name for each item. Is there a way to turn off token support for the Field Name field so that or the value of a token so that it just gets sent to the Field Name field as plain text?</p> <p>Example setup:<br> I create an iteration token to track my progress through the loops: loop_counter_token<br> I create a token to represent the field name: field_name_token<br> I create a token called "target_id" to hold the "target_id" text because that will get interpreted as a token in the token value field.<br> What I want to be seeing is: field_related_skills[0][target_id]</p> <p>The field_name_token's value is: field_related_skills[[loop_counter_token]][target_id]<br> The problem is, that when I do that, the result that the Form field: set value task gets is: field_related_skills[0]<br> So I end up writing something like: field_related_skills[[loop_counter_token]][[[target_id]]] in the field_name_token's value to get the brackets in there, but that's not interpreted correctly by the Set Field Value task either. I think it ends up still seeing: field_related_skills[0]target_id</p> <p>Bottom line is that because I don't have a way to turn off tokenization, the field name gets butchered because there's a token in there and once it sees that, everything gets treated as a token.</p> <p>Any ideas would be appreciated. I've tried adding more brackets and looking up if there's some sort of escape character I could use, but nothing's getting me where I want.</p> <p>Note that I can put in the one field name, like field_related_skills[0][target_id], and this works, but it doesn't allow me to iterate through a series of fields.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3>
issue