Score:2

How can I insert entity or view data into a form?

bz flag

We would like to put our adoption contract online to reduce paperwork, recordkeeping, etc. In order to do so, we need to insert data from an existing entity (specifically the existing record for the dog being adopted) into the contract.

My initial thought was to create a webform: However, there does not appear to be any way to insert field or view data into a webform.
Entityform was my next attempt. However, I cannot find a way to insert data from existing fields or views other than an entity reference itself, which doesn't do me any good all alone. Also, it does not appear to allow the addition of markup (uneditable text), which most of any contract is.

For example, I would like to select from our list of adoptable dogs and have specific data for that dog inserted into the contract (entityform); age, color, Chip #, etc. Alternately, I would like to get a view, inserted into the entityform record. I have created an EVA view that has all the per-dog information that would perfect to include in the contract.

To complicate matters, my programming skills are not. Therefore, I need to come up with a solution that works through existing modules without any coding.

We're on D7

Jaypan avatar
de flag
I would use a taxonomy for the dog types. Then your webform field would be a taxonomy field.
leymannx avatar
ne flag
Webforms should have an entity reference field. I'm almost 100% sure. This is all you need first to just get the data in. There rest is a matter of displaying the related data. But I think webform submissions can also be adjusted to display certain data in a certain form, for example to not just display the referenced animal node ID but also a certain view mode of that animal, containing the fields you need for the contract. You may need the help of an expert, though. Since you are a non-profit you might find some on https://drupal.slack.com maybe.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.