Updating Google Sheet after identifying the unique row and cell location

cresto.pgaxq2

11h

Great post!! I’m trying to figure out the reverse now.

Here is the scenario

  1. When page opens, USERID (Variable) identified
  2. Google Sheets Data Source uploaded and displayed
  3. When going to update values in DB, the app would first search the list of USER ID’s in the DB and find the cell that needs to be updated based on matching the stored variable in the app.

example:

Google Sheet DB

Column 1: UserID Column 2: Current Long Column 3: Current Lat
R1: bryanruddy0346 R1: -78.35362627636 R1: 35.9898457575
R2: dennissmith1111 R2: -78.436463732763 R2:35.4654763233
R3: dustinshane3545 R3: -78.222443434 R3: 35.6869847474

User logins and in creates user ID stored variable with inputs “dustinshane3545”

When clicking an update button, the function would filter through google db and establish the row that needs to be updated. Insert new lat’s and long’s from sensor data into the appropriate cells.

That way a user is not creating new entries all day. Then the app would have to filter out latest input with a time stamp. Which I could do. That seems like a lot of code.

I have coded the functions to retreave matching data.

Just want to update matching data

tatiang/manyone and I were working on some ACOS , SIN, details in another post. Getting more accurate numbers through the calculations through the sheet.

The calculations speed is quite good. Just need to have user update appropriate data as they use the app.

Thanks!!

What is your specific question?

From the blog from Muneer on filtering data that match criteria, I was not sure if the code available can identify within the Data Resource (Google sheet) a specific row and cell to send back an update.

If that makes sense.

I’m trying to figure out the best course of action that when the user clicks the update button

The update is based on their userid

Creating a Google sheet update is very simple.

Coded that.

But, within the update, I want it to first cycle the current user id against the list of user ids.

Call the location within the sheet the update needs to go and other specific info tied to that specific user id

Okay, I think I understand. Is your question: “How do I find the user’s user id in a column in a Google Sheet and then update other column values in that same row?” If so, that’s essentially a vlookup and it’s been discussed before on the forums.

I have an example of how to find the matching row here: Thunkable and returns a corresponding value from my sheet - #2 by tatiang

Once you have the row number, you can just use the update value block to change values in that same row (row number = row id).

Thanks for sending this.

I have that area figured out now.

Here in lies the next issue.

When a button is pushed to update the current lat and long, the label doesnt revise with the new google sheet data. The data is sent to the sheet, I can see the new calcualtions. But UI doesnt update.

I would prefer not to have tons of list viewers within the app.

I have tried creating a new label and making the old one not visible. But it still returns old values.

THoughts?

Here is the after click code.

It pulls old data

Ive messed around with the get object blocks.

It works , but returns all the current values in that column. Was trying to match via a unique user ID and return the correct single value in that column.

Thoughts

Can you have a Firebase path with a space in it (“Red Yards”)?

Is there a reason your loop uses the i variable to count but the j variable as the row id?

How were you trying to do that? I don’t see evidence of that in the screenshot above. Also, it’s best to avoid forever blocks in a situation like. Why are you using a loop inside of a forever block? Also, what is the purpose of the if condition you’re using? Are you just trying to see if the text input is not blank?

Lastly, putting the break out of loop block inside of the loop without a condition to trigger it means that the loop will only fire once. And because it’s not in the “do” section either, it may actually trigger before the get value at path block has time to complete.

I guess the simple question would be

After finding the row if and pulling the unique value from Google sheets.

Everytime the sheet updates from a new input , how do you get the most accurate version of the sheet?

The if logic was to ensure the new data makes its way to the Google sheet before pulling new data

Before using the row object , the value block works. It just doesn’t update correctly.

If it did , the rest would be solid.

The way the app works:

I can link the project as well.

  1. User creates login - saves user login as stored data

  2. once stored data has value, user is moved to action selection page.

  3. user device runs current lat and long and when finished allows for the user to select action. I have also programmed at that time the system to identify the unique row ID in Google sheets. Linked as data source

  4. when the user selects range , the username / lat / long are sent to the appropriate row line. That current works.

  5. when range is open , I have it setup to pull the unique values of preferred columns matching the user id.

  6. player wants to check current location. Presses button to reload device lat and long.
    System sends the data back to Google sheet. Sheet calculates.

But the label values that are tied to the sheet data doesn’t update.

That’s where I’m stuck

Since there is still issues with the cached Google Sheet pull.

Is the only option to display the google sheet to a data list view.

Upon click of new Lat/Long, delete current data list view criteria, update function, and display google sheet again within the list view.

To get current accurate data from the google sheet?

This would very much work.

I’ve tested when the load button clicks

The data list viewer after last device long is pulled, refresh data.

That matches

I just need the new “displaynewred” to filter off of the data list viewer.

Example

If(any list values ) match unique user id, pull subtitle from refreshed data list viewer

That is accurate

But it doesn’t look like you can compare against data list viewer

Thanks for all the help

B

Here is a work flow that works 100% on its load and reload cycle.

If there is a simple way of just displaying the subtitle of a row matching a specified row ID. You dont have to use get object function.

Thoughts ?

If the subtitle is easily listed, the 10 second removal of the re-run lat / long would be needed. I just put it in there to help refresh data.

I’m not sure what you mean by this. I don’t see a get object function in your screenshot.

Here is the initial load when the page opens.

When the load button is clicked the first data label would hide, and the second label would appear.

I didnt have a get object in this. It was more of a reference.

Is there a way to display the subtitle of a speficied item in Data List viewer?

I found this in the advanced section of the Data List Viewer