Drupal webform submission creating new table - drupal-7

I have created a webform. However I want that whenever I create a new webform and if I input some data and submit it, It must create new table in phpmyadmin for every new form that I create.
By default every submitted data goes to "webform_submitted_data" table. I want every webform that I create must have separate table.
Please give me steps on how to do that.

If you use the webform module as is, it will use its own database table structure exactly as you describe.
If you have particular requirements on how the data of your webforms is stored in the backend, you'll have to create your own custom module that either builds its own forms and does the data storing itself or that hooks into the existing webform functionality and changes just the storing and retrieving part of it.
In either case, it'll be a bit of work on your part to build that custom module.
How the data is stored isn't something you can just configure for the webform module... :-)
However, I'm not sure why you want to change the way the data is stored, but you're aware that you can export the submissions data as csv and other file formats to manipulate later, right?

The webforms mysql view module will give you a pseudo-table for each webform, allowing read access to the data.

Related

How to Add Records to 2sxc data from DNNSharp's Action Form

We have DNN Sharp's Action Form being used by client-partners to post new job listings. The Locations and Categories for these jobs are managed in a little 2sxc apps. We want to extend the ActionForm a little so that the user has the ability to add a new Location or Category when they post the job listing.
What method/action would I use in Action Form to be able to add a record to Locations or Categories data which are both inside the 2sxc App?
At the moment there is no quick way, because there is no adapter. You could create some manual code or create an adapter - but that's probably a day or so of work since you probably don't know the Action-Form APIs for all that.
But if you do do it, please share :)
I had a similar project. I wanted a form configuration tool for commonly used forms so that a staff person could fill out date, price etc. without getting under the hood.
I kludged it together using
var formFields;//Angular Controller For Form Fields
formFields = getScope('ActionFormCtrl').form.fields;
Then shoved in my 2SXC values
formFields.EventDate = "#Content.SessionDates";
formFields.$digest();
This is definitely not the angular way but it does work. Note that you need to run the JS after the form is rendered.

How to build sets of entity records using Breeze and local storage

I'm trying to create an off-line data collection app, using AngularJS.
I think, adding Breeze.js should help with saving and querying data to and from the browser local storage:
1) present the user with angular data entry form
2) when the "save" button is clicked - create a new Breeze entity and store it locally
3) the next time this form is used - create a second entity, and add/save it as a part of the same collection
I was wandering if anyone have tried to do something similar and could give me some pointers of how this is done.
I think it's viable and these links should help you to get started:
http://www.breezejs.com/documentation/querying-locally
You also might want to check this Angular sample aswell:
http://www.breezejs.com/samples/todo-angular
One caveat you have to have in mind is that Breeze will need to load the model's metadata from somewhere. Typically you hit a Web API asynchronously and get the metadata from there. However, on your particular scenario you should give a look at trying to load your metadata from a script file. Here's an how-to and discussion about it:
http://www.breezejs.com/documentation/load-metadata-script

Drupal Webform values before submit

I'm using Drupal 7, Webform 3.19 and CiviCRM 4.3.
I am using webforms to update CiviCRM information. What I'm trying to do know is to send an email after a webform has been submitted with the values after submit and values before submit, to notify the change done.
Is this possible? I've also been looking at Rules and I have found nothing...
Thx
The short answer is that you'll need to write a custom Drupal module or CiviCRM extension.
It would use hook_civicrm_pre and would have to distinguish between updates coming from your webform and updates coming from normal backend work. There may be some other hook for Webform that is called pre-saving that you could use for that. (hook_form_alter would allow you to add something to process pre-saving, but there's no sure way to know that you're getting the same contact ID as Webform does). Regardless, your module/extension would need to retrieve the relevant fields from the existing content and email it to you along with the form values.
You could alternatively enable CiviCRM's logging feature, but this will often cause problems with database bloat and upgrade headaches. (Which is why it's labeled as a beta feature years after it was introduced.)
A final option could be to only send this when there are defaults provided (i.e. only if someone is logged-in or using the checksum). There, you'd still need to write a custom module, but it could be more reliable in pulling the right contact's information.

Ext JS and loading data into a form

I have build a simple MVC application where I have a form and I need to load data into it.
I'm wondering if I should load this data using a store or directly using the model class. I have already a store for my grid.
So I see this 3 option.
Load data using Model class
Load data using the existing store (a grid uses this store already)
Create a second store and load my data using it.
If your store uses the same model and the data (record) you edit will defiantly be loaded in that store (for example if you open the form on a double-click of a gridrow) or can be inserted into it I recommend you to go with the store approach.
If you edit a record (model-instance) that will not necessarily loaded into the grid-store the you should load the data using the model.
A second store will only be necessary if both points above are true and you also wan't to batch multiple record (model-instance) edits from that form into one request to the server.
A third option is to bind the form directly to the server, but I recommend you to use the model-approach.
Note that if you need a different proxy for the store and the model
simply set one on the model and one on the store. By default the store
will inherit the proxy of the model but never the model the proxy of
the store

DotNetNuke -- Inserting URL parameters in forms

We are migrating our website to DotNetNuke and are looking to replicate the functionality of our survey page. Currently, on the bottom of every e-mail we send through our CRM system, there is a link to a satisfaction survey along with some parameters to pre-populate some of the fields. So the URL looks something like like:
/survey.aspx?ticketID=1234&userName=John+Doe
I found the custom module "helferlein_Form" which seems okay for actually creating the form that the user fills in, but I don't see a way to pre-populate the fields. DotNetNuke does let you insert tokens(ex: [Date:now], [User:username]), but I don't see a way to grab individual parameters from the URL. Is there something I'm missing that will let me do that?
I'm not familiar with that module either, but I would strongly recommend using Xmod for customized forms that allow you to easily grab url parameters.
I'm not sure about the module you reference.
However, in my experience Dynamic Forms from Data Springs would fit the bill perfect. It has the ability to pre-fill and even run custom SQL queries to get data.
You should definitely try our My Tokens module.
It allows you to access the URL parameters using [Get:ticketID] or [QueryString:tickedID]. You can also build SQL tokens that use these parameters to return a list of items for example to populate a dropdown.
Also try our Action Form module which integrates very nice with My Tokens.
If you have a module you like and want to use you can always write a little javascript to grab the variables out of the URL and pre-populate your form fields using javascript.

Resources