[APP] Google Sheets - Append to Google Sheets from a Flow

Hurray! Finally got it to work using BLL. Thanks for the help Arie. Much obliged.

Up until now I managed a little workaround. A script that checks if new data is added and then adds date/time/whatever to a chosen column.

The data from Homey gets logged into “Blad3” (Swedish for Sheet 3) and then imported to “Blad4” via ImportRange.

Why duplicate everything by using ImportRange? Because I suspect the trigger OnEdit doesn’t work when data is added through external sources - but it works with ImportRange. Hence linking column A from Blad3 to column A in Blad4 by: =IMPORTRANGE(“http-URL-to-sheet”; “Blad3!A:A”)

In Sheets (Extensions/Apps Script) I (well ok, ChatGPT) then added:

function onEdit(e) {
var sheet = e.range.getSheet();
var editedCell = e.range;

// Check if a new value is added in column A
if (sheet.getName() === ‘Blad4’ && editedCell.getColumn() === 1 && editedCell.getRow() > 1 && editedCell.getValue() !== ‘’) {
var newRow = editedCell.getRow();
var timestampRange = sheet.getRange(‘G’ + newRow);
var date = new Date();
var timestamp = Utilities.formatDate(date, ‘GMT’, ‘YYYY-MM-dd HH.mm.ss’);
timestampRange.setValue(timestamp);
}
}

Anywho, it’s all moot now that the BLL formatting works. Sweet! :heart_eyes:

1 Like

Using the app for over a month now to write my p1 meter values to a google sheet. I run the flow every hour. Noticed that, although the flow runs every hour, sometimes the values aren’t logged into the google sheet. Anyone recognize this and have a clue how to solve this?

Logging P1 ones a day, have seen that lately some days were missing.

It’s even worse. Not missing some values but a lot of values. See screendump

Contacted Athom. They say it’s on the google side. The only suggestion they had was to send the same info once the first time results in an error.

Tried that but it doesn’t solve it for me

As alternative, you can consider [APP][Pro] Simple (Sys) LOG - Use this app for Simple (Sys) Logging

I’m familiar with that app. The advantage iof google sheets is that it can be used in excel as a datasource and all my graphs are refreshed when opening the excel file. Don’t know if that’s possible with simple log as well

Exporting to excel always shows “the latest x logs”. And it’s even possible to call a local URL with the latest logs:

Same problem here, but no solution found yet…

I solved this problem by starting the flow x:01 instead of x:00.

I think I don’t understand what you mean…

I guess he solved it by starting the flow one minute after each hour, instead of exactly at each hour?

correct

I also have a problem with no data being logged to sheets. I’ve tried different flow starts, as 11:59pm and so on with data only being logged 1 of 5 days. Flow only runs once a day. Frustrating…

You are aware of the fact you can log error messages from flow cards in Advanced flow?
It might reveal the cause…

Example

1 Like

I was not I can check this out.
But when I test the flow it works. And if I set a time in the next minute when I’m inside the advanced flow it reports. But not at the time I actually want it to report.

Have a strange issue with the Google Sheet flow; When I start the flow from test mode, the flow runs perfectly and a new row is added to the spreadsheet. However when the flow runs unattended (every hour) I get a “Rate Limited” error. I added a retry 65 sec’s later, but still the same rate limited. Do you get a rate limited as well?

moved start of the flow to 1 minute after each hour (0:01, 1:01, 2:01 etc) and now it works like a charm

1 Like

After latest update of the Google Sheets app I have an issue selecting the Google document:
image
I’m the only one having this issue?

Same here, previously that was a selection list of sheets on ones account.