Hello All,
I was wondering if it is possible to write the data in (export to) google sheets from Axure?
Is it possible to write data into google sheets from Axure?
Thereās no native Axure-supported solution but there is something created by one of the users here on the forums:
https://forum.axure.com/t/skip-the-repeater-learn-how-to-use-google-spreadsheets-as-a-database-instead/34701/8?u=nkrisc
Hi Nathan -
I went through this a while back, and it seems to only read from Google spreadsheets and not write to them. (I needed the writing solution as well.) It is possible I missed something, and I imagine if thy have an API for reading the sheet, writing is probably possible.
I already have this library. But it allows only reading from google sheets. It does not allow for exporting to google sheets.
Ah, didnāt realize that. In that case Iām not aware of any existing solution anyone has created.
Have a look here for how to update Google Sheets: https://developers.google.com/sheets/api/guides/batchupdate
But as for doing it from Axure, looks like you might have to write that yourself.
Hi Kushal,
The library you are referring to (from Usability Matters) canāt be found anywhere now. Could you send it to me or make it available somewhere?
Iām sure a lot of people would be interested in.
Thanks for your attention.
Hi, the short answer yes it can be done. I did this a few years ago with the objective to see if I could get users to vote on a prototype, with the vote collecting the users name, selection and comments and then post this to Google Sheets. It is still working today so I can confirm this works for Axure v8 as well as v7.
So the process (and I am not a coder so forgive me if there are better/simpler ways).
Step 1: Create a Google Form
This is the most important step as the only way to populate into the Google Sheet is via a Google Form (from my understanding).
Add whatever data types you need in the form for your collection and you will have the option to save the form results to a Google Sheet. This will create the link between the Google Form and the Sheet.
Step 2: Publish or select the View Live Form option, right click on the resulting page and view the source code
Now you want to publish the form and look at the source code. Key information you need to collect from the source code (and copy and paste it somewhere) is:
-
Form URL ( this will be located in the <form actionā"ā¦> section of the code. It will look something like: https://docs.google.com/forms/d/e/1FAIallaii28s8sdj29duj28j2j2hui3-23-2EMm_tP-IOjlAFQ/formResponse )
-
The entry ID number for each of the form fields that will collect the data. (ie inspect element of each form collection field and copy the entry.117626631 number
Do this for all of the fields you want to collect.
Step 3: Axure prototype
Ok that is the most complicated piece. The next steps are quite simple.
- Create your prototype with appropriate data collention elements (ie text fields, comment boxes, dropdown selectors, radio buttons, etc)
When you are ready to pass data into Google Sheets, you need to have a submit button (or similar UI trigger for the user to click on).
For my example lets just assume it is a submit button at the bottom of the page that collects the data within your axure prototype.
-
Add an OnClick event to the button and
-
Select Open Link and select the link to an external URL or file
Now this is where it gets slightly tricky again
-
Flick the fx button the the right of the Hyperlink textfield - this will open up the condition builder
-
Assign local Variables (ie LVAR1, LVAR2) to each of the pieces of data you want to pass to the Google sheet. In my prototype i set the users name to LVAR1, their selection to LVAR2, etc). You should have a list of local variables you can now play with in your condition builder at the top of the popup window.
-
Find the URL for your sheet and copy it into the expression builder (eg https://docs.google.com/forms/d/e/1FAIallaii28s8sdj29duj28j2j2hui3-23-2EMm_tP-IOjlAFQ/formResponse)
-
Now all you have to do is start appending the parameters to the end of the URL, listing the form entry ID number against the corresponding VAR field with a &submit=Submit (as this will force the Google Form to post to the linked Google Sheet
FOR EXAMPLE your version should look similar to mine below:
https://docs.google.com/forms/d/e/1FAIallaii28s8sdj29duj28j2j2hui3-23-2EMm_tP-IOjlAFQ/formResponse?entry.14731423=[[LVAR1]]&entry.254818544=[[LVAR2]]&entry.1649357600=[[LVAR3]]&entry.1961835596=[[LVAR4]]&submit=Submit
Now all you have to do is test your Axure prototype. Open the prototype, add data into the fields you want to pass, click submit (and it should show you the Google Form completion success message). Check your Google Sheet and you should see the data in there.
It definitely still works for me so let me know if you get stuck and Iāll try to help.
This is great thanks. I got it to work fine and form data is dripping into the G-Sheet.
Next goal: How to prevent the Google success message from showing?
Iād like to keep my participants in the Ax Prototype experience. I tried reloading the Axure page (instantly and with a short wait), but in both trials the data is not registered in the sheet.
Maybe you can load the google url into a hidden iframe, so that you stay within your prototype?
This was really helpful, thanks, Wake!
I got text fields to work, but Iām having trouble getting radio buttons to work. Should I be using global variables instead? Help please!
Hey mate, yeah I would definitely look at using the global variables for this one. On trigger of the radio button, set a global that is then added to your VAR list being sent to the spreadsheet.
Let me know if you canāt get it working.
Worked perfectly for me! One noteā¦ when I leave my form idle for about 45+ seconds then fill out my form I noticed that the data does not capture in the google sheet. I have to refresh the page then it works.
Any ideas?
I figured it out. If you leave your form page idle for a while and try to submit it wont show in your google forms doc. If you refresh your page and submit you will then see two entries posted. I guess there is just some kind of lag on the sheets side but its there.
Thanks again,
-Marc