Experiences using LS with Google® drive™ spreadsheets©

More
2 years 8 months ago #133565 by Qsgt
Qsgt replied the topic: Experiences using LS with Google® drive™ spreadsheets©
OK. Thanks for the quick reply but I have some follow up questions:

1. I'm relatively new to XML where would I go to find the standard method?
2. So, if I share the sheet like I would a regular Google Document, it will still update?
3. New Question, is it possible to only export a response to the sheet if there is a value in the response? If so, where do I go to find out how?

Thanks for the help,
qsgt

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #133574 by Mazi
Mazi replied the topic: Experiences using LS with Google® drive™ spreadsheets©
This is a very interesting approach! Thanks for documenting it at the workarounds .

Note that for sending emails to a predefined address if question X was answered "Y" is something that can easily be done from within Limesurvey. That's nothing I'd recommend to use the Google service for.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com
Want to use your survey offline -> www.offlinesurveys.com

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago - 2 years 8 months ago #133670 by Ben_V
Ben_V replied the topic: Experiences using LS with Google® drive™ spreadsheets©

qsgt wrote: 1. I'm relatively new to XML where would I go to find the standard method?

(re)read this blog entry from the begining; there are some links to the manual describing the whole process and other pieces of code.

qsgt wrote: 2. So, if I share the sheet like I would a regular Google Document, it will still update?

Yes of course. My experience is that all documents update at least 2 or 3 times hourly.

qsgt wrote: 3. ...is it possible to only export a response to the sheet if there is a value in the response?

Sorry. I don't understand fully the question, but remember that sheets content is linked to the query presented in your xml file... For example if you query included a statement like "where submitdate is not null", incomplete records won't be returned.

....

Mazi wrote: Note that for sending emails to a predefined address if question X was answered "Y" is something that can easily be done from within Limesurvey

Yes... but for more advanced needs, it's hard to imagine easier and more complete possibilities than those managed with apps script.
For example it's quiet easy to handle:
- Automating a Help Desk Workflow
- blacklists of email addresses or domains (eg. yopmail.com).
- Delayed emails for example x days or months after submission.

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 2 years 8 months ago by Ben_V.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #137690 by mprados
mprados replied the topic: Experiences using LS with Google® drive™ spreadsheets©
"I made this morning a 2 questions survey sample with the link to the spreadsheet living in the completed message…
I can explain the process later if needed."

I think the link is no longer available, thanks for the follow up!

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #137701 by Ben_V
Ben_V replied the topic: Experiences using LS with Google® drive™ spreadsheets©

mprados wrote: I think the link is no longer available, thanks for the follow up!


Hi @mprados... I will replace it when I'll have more time.
This said this Demo was only made to show that this is fully possible & quiet easy.
So I suggest you to start directly your own test based on what I wrote on the doc.

For users starting with this method, I think the best is first to work with a static xml file...
For example if you want to import the data from:

http://www.xmlfiles.com/examples/plant_catalog.xml
  1. Create a new GG sheet called "Sheet_1"
  2. Create a new script (Tools => Script editor )
  3. Paste the following script, save and run ( ►)

function getData() {
 
// related with Sheet "Sheet_1"
 
 
//  1. Create headers
// https://zapier.com/blog/google-apps-script-tutorial/
// * * * * * * * * * * * * * * * * * * * * *
 
// Create headers
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName('Sheet_1');
 
 
  // Set the headers values
  var values = [
    ["COMMON", "BOTANICAL", "ZONE", "LIGHT", "PRICE", "AVAILABILITY"]
  ];
 
  // Set the range of cells
  var range = sheet.getRange("A1:F1");
 
  // Call the setValues method on range and pass in our values
  range.setValues(values);
 
 
 
//  2. Import data
// * * * * * * * * * * * * * * * * * * * 
// If .XML file => use semicolon  -> plant_catalog.xml"; "//COMMON"
// If xml generated with .PHP file => use comma -> plant_catalog.xml", "//COMMON"
// * * * * * * * * * * * * * * * * * * * 
 
var importCommon = '=IMPORTXML("http://www.xmlfiles.com/examples/plant_catalog.xml"; "//COMMON")';
var importBotanical = '=IMPORTXML("http://www.xmlfiles.com/examples/plant_catalog.xml"; "//BOTANICAL")';
var importZone = '=IMPORTXML("http://www.xmlfiles.com/examples/plant_catalog.xml"; "//ZONE")';
var importLight = '=IMPORTXML("http://www.xmlfiles.com/examples/plant_catalog.xml"; "//LIGHT")';
var importPrice = '=IMPORTXML("http://www.xmlfiles.com/examples/plant_catalog.xml"; "//PRICE")';
var importAvailability = '=IMPORTXML("http://www.xmlfiles.com/examples/plant_catalog.xml"; "//AVAILABILITY")';
 
 
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet_1').getRange('A2').setValue(importCommon);
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet_1').getRange('B2').setValue(importBotanical);
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet_1').getRange('C2').setValue(importZone);
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet_1').getRange('D2').setValue(importLight);
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet_1').getRange('E2').setValue(importPrice);
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet_1').getRange('F2').setValue(importAvailability);
 
}


That's all :) ...your sheet will now look like:


Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Attachments:
Last Edit: 2 years 5 months ago by Ben_V.
The following user(s) said Thank You: abudzarr

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #163659 by abudzarr
abudzarr replied the topic: Experiences using LS with Google® drive™ spreadsheets©
I have followed the above prescription, and I could transfer the limesurvey result to googlesheet. :)

However I end up with an issue. As I have set my questions non-mandatory, some of the responses are 'NULL'. The responses were correctly displayed in the XML file. But IMPORTXML apparently ignores the NULL values, leading to wrong order.

For example the xml codes shown here https://snag.gy/mGbTYJ.jpg was read into a googlesheet.
The second rater Zul Amali did not rate on REL;

In the google drive, https://snag.gy/WL3xHT.jpg ,
As you can see the column REL for Zul Amali which should have been empty, is taken up by the next REL value which is 3 in the next node.

I have tried changing xmls:xsi value from default to true, but that did not bring any effect.

I am loss here, any help is much appreciated.

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #163661 by Ben_V
Ben_V replied the topic: Experiences using LS with Google® drive™ spreadsheets©
Hi @abudzarr,

Your xml file is generated by a php file, right?
In this case you can try to add some php code to replace all null values by a dummy value (like "999")


(it's quiet hard for me to help you without making some huge work to reproduce your issue...)


Ben-

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago #163737 by abudzarr
abudzarr replied the topic: Experiences using LS with Google® drive™ spreadsheets©
Thanks Ben. I did not like '6' to appear in my list of responses, but I guess, having the show 'no answer' option ON would have solved the whole problem. It would relieved me the learning curve to get that php snippets you are talking about.

Regards.

Please Log in or Create an account to join the conversation.

More
10 months 5 days ago - 10 months 5 days ago #163740 by Ben_V
Ben_V replied the topic: Experiences using LS with Google® drive™ spreadsheets©
How many "not mandatory" questions (included in xml file) do you have ?

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 10 months 5 days ago by Ben_V.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!