Is it possible to send the global variable value to google app script from Axure?


#1

Is it possible to send the global variable value to google app script so that I can assign the value to the google spread sheet.
or is it possible to assign the value to google spread sheet cell let say A1 with the cell URL get from google spread sheet by right click?


#2

@ignatiuser I would say most things are possible if handled properly with Javascript.

As you can see from here, all global variables are actually stored explicitly in the hidden DIVs of the HTML, then the problem becomes easier

=====

how to implement the javascript code is beyond this forum though.


#3

It would be wonderful if someone could provide a sample working Axure project demonstrating this! It would be a game changer for me.


#4

Thanks for your suggestion Steven.
As I am not very familiar with javascript in Axure, have you done any demonstration before?It will be great if you can help uploading a sample for everyone who are in trouble with this problem.
Thx


#5

@ignatiuser @dav123456

I’m no expert to Javascript, this is what I can do at the moment.

SendValueToGSheet.rp (53.5 KB)

PURPOSE

  • set current timestamp to G-sheet A1 cell

REFERENCES & SYSTEMS

STEPS

  • set your browser to allow all cookies
    image
  • generate your client id & api key
  • publish this Axure project to cloud (can’t figure out how to make it work with localhost preview), note down the URL
  • go to developer console, add top level domain (axure.com) into whitelist, also add this project URL into Authorized Origins
  • Create a g-sheet to write into
  • Modify the code, the red highlight ones are required a change
    spreadsheetId : the id in the g-sheet url, 1C50D9cL8hiSQJi34Gv6mCrB71mRhuKB39HIWhYCBEio for this example
    range: the cell range you need to write into
    valueRangeBody: the data you need to write into, please find “how to implement” for the format
    API_KEY : your api_key
    CLIENT_ID: your client id
  • Inside the Axure page, (i’m not making it perfect so the workflow sounds a bit weird). You need to
    – click the “set g_timestamp = NOW()” button
    – wait for around 5 seconds for the background requests complete
    – click “sign-in google” button, then if everything is configured correctly, you will see the popup dialog as you to grant permissions
    – finish granting the permissions
    – click “set g_timestamp = NOW()” button again
    – the value should appear in the g-sheet

#7

hx for your help. I will have a deep look into your work and see I can figure some more out. I will let you know if I get any progress.
Thx so much