- Posts: 14285
- Thank you received: 2583
Ask the community, share ideas, and connect with other LimeSurvey users!
(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: 1. I'm relatively new to XML where would I go to find the standard method?
Yes of course. My experience is that all documents update at least 2 or 3 times hourly.qsgt wrote: 2. So, if I share the sheet like I would a regular Google Document, it will still update?
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.qsgt wrote: 3. ...is it possible to only export a response to the sheet if there is a value in the response?
Yes... but for more advanced needs, it's hard to imagine easier and more complete possibilities than those managed with apps script.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
mprados wrote: I think the link is no longer available, thanks for the follow up!
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("https://www.xmlfiles.com/examples/plant_catalog.xml"; "//COMMON")'; var importBotanical = '=IMPORTXML("https://www.xmlfiles.com/examples/plant_catalog.xml"; "//BOTANICAL")'; var importZone = '=IMPORTXML("https://www.xmlfiles.com/examples/plant_catalog.xml"; "//ZONE")'; var importLight = '=IMPORTXML("https://www.xmlfiles.com/examples/plant_catalog.xml"; "//LIGHT")'; var importPrice = '=IMPORTXML("https://www.xmlfiles.com/examples/plant_catalog.xml"; "//PRICE")'; var importAvailability = '=IMPORTXML("https://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); }