EMG sensor App to send data to google sheet

Use PostText not PatchText

and the error message was ?

Did you update your apps script as I advised (and create new version)

However this gives me error message. I have been try to resolve it but not successful. I did create a new version for the script code too.

so what is the error ?

get the value of responseContent

this is the error messa

ge.

Your issue is probably here:

Hello @TIMAI2 I just did that but it does not work.

Show what is coming back in global Receive_data, then we can fix it.

It is still the same error message.

global Receive_data

The same error message keeps popping up. This is the code block

Not correct Anthony - compare the Bluetooth part to my example. Get the IF's right too or your App will keep crashing.

The WEB1 code does not look like TimAI2's either.......

Use the | delimiter in your Sketch and in the Project. Note that, in the example Project, App Inventor is"told" what to expect from Bluetooth on Screen Initialize. I think you may be better off modifying my example to suit your display and Google Sheet requirements as there are many little things that add up to robustness.

I have used your code blocks and made some changes, but i cannot send sensor data to google sheet. I still need assistance to solve my issues.

If you want to test your google apps script try this:

image

if you get the data in your google sheet, then at least you know that part works, and you can focus on correctly getting the data from your arduino

If it doesn't work we can have a look at that too (e.g. provide full error messages / responseContnet)

i have done this. I wrote required codes to the google script editor but it does not work.

therefore, as requested, provide the error messages returned. You will either get app notifications, or a message in your responseContent, or both!

There appear to be a couple of errors in your blocks:

  • you need an & before Voltage - I am sorry I left this out of my blocks too :dizzy_face:
  • in your script you show the parameters e.parameter.Voltage and e.parameter.Sensor (note the capital letters). This is how I put it in the blocks that I posted, but you changed these to lowercase

image

There actually no error message. Just that nothing saves on the google sheet.

You may not be using Web1.GotText. Add these blocks to your project, and then try to send the data to your google sheet again. What do you see in Label1.Text

I also note that your google apps script does not have a return element, this is usually required. You could, as previously suggested, edit your script to this:

function doPost(e) {
var ss      = SpreadsheetApp.openByUrl("YOUR_SHEET_URL");
var sh      = ss.getSheetByName("Sheet1");
var Sensor  = e.parameter.Sensor;
var Voltage = e.parameter.Voltage;
sh.appendRow([Sensor,Voltage]);
return ContentService.createTextOutput('data appended');
}