Entity reference fields¶
Use the FlowDrop Entity Reference Workflow action. It runs the same way as the text action but expects the workflow to return entity references, and shows them as chips.
Supported widgets¶
Field type entity_reference with one of these widgets:
entity_reference_autocompleteentity_reference_autocomplete_tagstagify_entity_reference_autocomplete_widget(from Tagify)term_reference_tree(from Taxonomy Term Reference Tree)
Output format the workflow must return¶
The value under the output key must use Drupal's autocomplete format:
Term name (12), Another term (34)
The action finds each (ID) and takes the text before it as the label, so
labels may contain commas. Entries without an ID are ignored. Turning names
from a model into IDs is the workflow's job, for example with a node that
looks up taxonomy terms by name.
Editor flow¶
- The editor clicks the action button on the reference field.
- A dialog, Term Suggestions - Click to add, lists each suggested entity as a chip.
- Clicking a chip adds that entity to the field and marks the chip as added. Add all adds every chip. Done closes the dialog.
- If no entries can be parsed, the dialog says no suggestions were provided.
How a chip is added depends on the widget:
- Autocomplete and tags widgets: the
Name (ID)entry is added to the input. - Tagify: the tag is added through the Tagify instance, skipping tags already present.
- Term reference tree: the matching checkbox is checked and its branch expanded.
Replace and append¶
Value Mode decides what the suggestion contains:
- Replace: only the entities the workflow returned.
- Append: the entities already in the field, followed by the new ones. Duplicates are removed by ID. Existing entities the editor cannot view are left out of the merged value.
Examples¶
- Suggest tags from the body text.
- Suggest a category from a fixed vocabulary.
- Suggest related content to reference.