How to execute Google Script bound to Google Form on Form open - forms

I am developing very first script for Google Forms. And of course I need help :)
Intro:
Script needs to collect external data (API), create drop down filled with fetched data and upon submission send all responses to another API.
So far I got:
1. Fetching external API - works;
2. Creating drop down filled with data - works partially;
3. Sending data - not yet started.
I have following specific questions:
For some reason data in drop down is not being refreshed (fetched) on form open. I have it in function onOpen() and created trigger to execute this function on open as well. However only way to get new data is to go to script editor and run it :( Which is not the point.
Drop down is currently at the bottom of the form. I saw that you can use index, but I can not get it working. Can someone give me working example of how to use https://developers.google.com/apps-script/reference/forms/form#moveitemitem-toindex properly?
Thanks!

Related

How to copy edited google forms entries to another sheet - Keeping original response and edited

We are in the process of setting up a test for staff using google forms. It works great and I have enabled users to be able to edit their responses.
What we need the form to do is keep the original submitted data too so we can see how many questions the user got wrong and how many they got correct on a resubmit. Currently resubmitting the data overwrites the original. There are a lot of questions in the form so the user re submitting another would not work. Highlighting the ones they got incorrect and giving them a second chance is what I am after.
My thoughts were to copy the data to another sheet everytime either a new entry was made or when a form was edited.
I have not done much work with Google Forms or Sheets so I am starting from scratch.
Thanks,
Luke

jxa (javascript for automation) - get notification when user changes selection in Contacts

I am using JXA to write scripts that basically copy data from one application to another.
Now I would like my script to get a notification whenever the user changes selection (eg in the Contacts Application).
I have gone through the docs and searchd the net but I cannot find one example pointing me in the right direction.
Is it possible at all? Thanks

CRM365 On Prem - Document Templates: how to hook the select event in the form menu

The CRM365 Form displays a convenient document template dropdown button where a number of actions could be initiated. Additionally, it displays the list of already existing document templates. The user can select one template in the list and it is downloaded locally by your browser. So far all good.
Our goal is actually to select the template, retrieve it, and create it in a Document Management repository. We have a working solution for this but it involves too many pieces and steps so we are looking for some better ideas.
Ideally we are looking for a solution where we can:
"intercept" the click on the template item and run a JavaScript function
If we find a solution to this, the rest would be just calling our custom workflow to do the rest of the job.
So, is there any way to hook that "select/click" event from the form menu?
Thank you very much for your help and advice.

Zend form application

Im writing a program in zend using zend forms. Everything is fine the form process well to the database but the problem is that the form is too long +-50 inputs which all belong to one database table. How can I find a way to shorten/break some parts of the form to fill in first and then use a next link to fill the rest, bit by bit, and then a finish link to process the form to the database. Basically break the form in parts so that the user wont give up easily or become lazy while filling in his/her details. Can I use multipage form if so, how can I go about it?
Thanks in advance
Use Sub forms for each step (page). See this example - http://framework.zend.com/manual/1.12/en/zend.form.advanced.html#zend.form.advanced.multiPage
As each step will probably contain its own validation, I suppose that the best approach would be to write a separate form for each step in the wizard. After successful validation of one form, store the results in the session and proceed to the next step.

Update database automatically before loading page

I'd like to update (e.g. dates or upcoming events etc.) in some tables in my database automatically before loading the rest of the page. For example the first time every Monday someone gets on the website.
Before I used joomla I had a php-script which I included at the beginning of every page and that worked pretty well.
But with joomla I don't know where to insert the (adjusted) script. Should I create a (content) plugin? But where/how would I trigger it?
Thank you
I got it working by using a cron job that calls a view especially made for this task. Using the URL with &format=raw so that no unnecessary joomla html gets loaded