FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
related fields / mixed view
#1
Hey Ben:

I would like to integrate related fields from other forms into the views.

For example if there would be the forms "registration" and "oders" I would not like to duplicate all the entries like "adress", "email", etc for each order.
I would like to have a registration form with "adress" and "email" and a order form with "article", "amount" and "customer".
Now i would like to have an option to create a view for the order form where I can refer to fields related to this customer in the registration form.

The result will be something a mixed view with fields
registration.name (not editable)
registration.street (not editable)
registration.city (not editable)
registration.email (not editable)
order.amount
order.article

I hope this example clearifies what I want.
There are plenty of other applications where this feature would be helpful.

Is this possible with Form Tools?

Cheers,
Hannes
Reply
#2
I have the same need. Is it possible to have an answer? Or is there an answer somewhere else?
Reply
#3
Hey guys,

Hope all is well, Hannes. Man, you ask lots of difficult questions. Smile It's excellent.

So right now, no - this isn't possible. But you can do it with 2.1 - not so much with Views, but with fields themselves.

So in 2.1, any radio button group, checkboxes, dropdowns and multi-select dropdowns can get their options from either a Field Option Group or (what's new) from the contents of any other form field. This is a big improvement: it lets you link your data together between forms.

To take up your example, you would create 4 extra fields in your Order Form. These would be (say) dropdowns that are mapped to the name, street, city and email fields in the Registration form. Then, you'd add those fields to a View in your Order form (and make that View have those fields as editable). When you edited the Order form submission with that View, you could select the appropriate values from the dropdowns. They would be populated with all values from all submissions in the Registration form; e.g. the "emails" dropdown would contain everyone's email address. (Options appear with the submission ID in parentheses at the end, so you know for sure which registration you're dealing with).

Now here's the problem, which your post has made me understand better: this will be a pain to configure each time you create a new Order. You'd have to re-select the same person's info each time.

What we *really* need is a button on the Registration form's Edit Submission page saying "Create Order". This would create a new entry in the Order form table, link to it, and populate the values for the mapped fields. That way you could even make the View that you're linked to in the Order form have those fields non-editable, like you suggested.

I wonder if this should be a module? It seems a little specific to be in the core script. But I *do* see this as being extremely valuable: as soon as it becomes possible to map the fields between forms, your scenario will become more and more common.

Thoughts?

- Ben
Reply
#4
Hi Ben,

everything is fine and I was very happy to hear about your recent formtools plans for the summer.

Quote:What we *really* need is a button on the Registration form's Edit Submission page saying "Create Order". This would create a new entry in the Order form table, link to it, and populate the values for the mapped fields. That way you could even make the View that you're linked to in the Order form have those fields non-editable, like you suggested.

I am not sure if we are thinking about the same solution:
I am very glad that there is a solution for this: http://forums.formtools.org/showthread.php?tid=951
But what I want now in addition is not a single field related to another view/form, I want to have a full submission with all the fields related to it...

For the example above it would look like this:

I have a database "registration" with a record like this:
Code:
registration.submission_id: 1
registration.name: Hannes
registration.street: Habersaathstr. 1
registration.city: Berlin
registration.email: guest@gmx.net

And I have a form "order" where i am asked about:
Code:
order.costumer (related with registration.name): Hannes
order.amount: 20
order.article: 3

If I now add a costumer "Hannes" it will save the following to the database:
Code:
order.costumer: 1 (submission_id from record "Hannes" in "registration" database)
order.amount: 20
order.article: 3

So even if the user will change its name and address it will be still related to the order.
Since I have a field which is related to to another database, I should now be able to select fields from both databases to a view for "order":

Code:
selected fields:
registration.name (not editable)
registration.street (not editable)
registration.city (not editable)
registration.email (not editable)
order.amount
order.article

The only things that you have to take care is that you can only relate to fields which are unique in order to have exactly one submission_id which is related and only to records which can not be deleted.

Hope it is a bit clearer now what i mean ...and of course I will be happy with 2.1 also without this feature... maybe in 2.1.1...? Big Grin

Thanks a lot! I keep following the project and I am getting more and more excited about the first release of 2.1.

Best regards from grey and rainy Berlin
(in May it hopefully will be nice and sunny all over Europe),
Hannes
Reply
#5
Hi Hannes,

Thanks ever so much for clarifying this. I've given it some thought and I think I'll add this functionality through a separate module. Currently I've dubbed it the "Advanced Field Mapping" module. Basically it let you do exactly what you need, however I'll only be releasing it for 2.1.

I have a hundred other things to complete first, but this is very much on my radar!

- Ben
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)