Get data from exteral source into OKS Survey's forms - survey

Is there a way to add external data to the ODK Survey form, like the "pulldata" method in the Collect Forms? I know about queries but this are used to populate a multiple choice prompt with values.
I need a tool that will get data either form outside the form (from a cvs for example) or from an array or something inside the xlsx form, and set that value to a prompt inside the form. Any ides?
Thank you!

Related

Populate Wicket table with Ajax

Is it possible to have 1 input text field that accepts characters from the user, and as the user types, queries to a webservice are launched, and to update the contents of another component dynamicaly with the results of the webservice (which would be a table below the input text)?
If you prefer to use Wicket form controls and Data Table component then you need to make the call to the REST service in your impl of IDataProvider.
Otherwise, as I explained to you earlier today in your other SO post you can do this directly in JS without Wicket. It is a matter of taste and skills.

What is the best way to persist data between pages within admin on rest

We have a simple CRUD admin on rest project and with one of our objects, we would like to "Save and create another" with some prefilled in form fields. What is the best way to persist data within AOR?
Right now, I have a solution working using localStorage, but it is not awesome. I have to refresh the 2nd form to have the data prepopulated.
We are thinking about modifying the URL params to include the prefilled form fields, but this seems like a lot of work for something that should be pretty straightforward, particularly within an admin framework.
Thank you in advance!!
The Create component accepts a record prop to setup initial values of the form. This values is merged with the values of the defaultValue prop (can be a function) and values from the admin.record state in redux.
So in your situation the defaultValue prop would allow you to generate the data from the params prop of redux router.

How to fetch data in tabular form in _new page

I'm creating a project in ruby on rails. Is it possible to add data just like normal form and save them in database in show page? Is it possible to add data in tabular form and let the user save the data in batch (i.e. 5-6 record at a time) for the same employee? If so, then how can I achieve this functionality?
You can read all needed information from file and parse it into the array of objects, and then use https://github.com/zdennis/activerecord-import gem for insert it in db (for production).
also, you may look into db/seeds.rb file for adding new data in develop.

Can we prepopulate the webform fields with values in webforms for marketers?

We have a requirement to pre-populate the Contact Form with user information on load if the user is a logged in user. So that, user need not fill his information using the webform.
Is there any way to do this using webforms for marketers?
Data is coming from a service api in json format. Need to figure out a way to bind it to fields either in server side or in client side.
Sitecore Version 7.1 140117 WFFM Version "Web Forms for Marketers
2.4.0 rev. 140117"
Have a look at Sitecore - Webforms For Marketers Form - Use ReadQueryString Option. Basically, there is a checkbox, ReadQueryString, in presentation details that gives you the option to fill in the default values from the query string. If checked, you use the item names of the fields (not the display name or title) as keys and the values you want to set the fields to as the values in key-value pair in the querystring.
Create a new rule based on use default value from user profile [fieldname] field and amend it to pick up the value from your service API.
This will be your best way and simplest option in my opinion.
I use this same approach prepopulating ucommerce data from its API.
Create custom field and then you can pre-populate values as per your need.
Like if you want to populate any value in Single line text field the create custom field for this and then reflect forms dll and copy code then update code as per your need.
Please check https://sitecoretweaks.wordpress.com/2015/02/20/custom-field-type-for-sitecore-web-form-for-marketers/ blog post for more details.

In what file are values received from edit.php?

I'm creating a custom field called provinces where I have built a multi-select field. This field receives a JSON keyless object [3,4,5] from the database which I then apply to the input in getInput() in province.php. I have managed to this on the output, but I need to write any values selected back to the database.
Where can I get the values that are then passed back if the user selects other options (in the back-end form edit.php) in the multi-select?
In other words, where is the $_POST array received before either it is redirected back to the form (Save) or to the list page (Save & Close)?
Please correct me if I'm wrong.
Thanks in advance.
In the model for your form view, look for the function prepareTable. This is a good place to prepare/sanitize the data prior to saving.
If you want to process the data further after it is saved, you can use the function postSaveHook in your form controller.
Or you can of course also do something during save in the tables store function.

Resources