Get a cell, update a cell (Google Sheets)

(Joe Hatch) #1

Is there an easy way to do this?

I have the cell reference mapped and return the Google Sheet ID for that row.

E.G. I am doing a lookup on a variable, returning the whole row which returns the values:

_d88ul: 0, _dkvya: 1, _dmair: 3

then I want to store the output of say, _dmair: 3, change the value and push back to that.

The only issue is that the ID is the same across rows, but different by column.

(Kellsey Shaw) #2

Hi Joe,

When you update a row, you use the Row ID and the put the values in the inputs provided so you don’t need to know the cell references :confused: Is there a specific reason that you need the cell references when updating in Flow XO or did you just need them for something else?

(Joe Hatch) #3

Here’s a screenshot of my sheet.

The cell containers are the IDs of the rows, but will all start as 0.

This is a monthly track of lead supply in our business so for instance, an Equity Release Mortgage lead comes in, we cross refrence the date (01-Oct) and then take that B3 cell value, increment it +1, and return it to B3.

Am I missing something here?

(Kellsey Shaw) #4

When you return a row, you are returning the names of the columns so searching Equity Release Mortage, would give you columns called 01-Oct, 02-Oct and so on so you would just select the one that you wanted to use.

(Joe Hatch) #5

The output is:

Content
leadvolume: Omne, _cokwr: 0, _cpzh4: 1, _cre1l: 2, _chk2m: 3, _ciyn3: 4, _ckd7g: 5, _clrrx: 6, _cyevm: 7, _cztg3: 8, _d180g: 9, _d2mkx: 10, _cssly: 11, _cu76f: 12, _cvlqs: 13, _cx0b9: 14, _d9ney: 15, _db1zf: 16, _dcgjs: 17, _ddv49: 18, _d415a: 19, _d5fpr: 20, _d6ua4: 21, _d88ul: 22, _dkvya: 23, _dmair: 24, _dnp34: 25, _dp3nl: 26, _df9om: 27, _dgo93: 28, _di2tg: 29, _djhdx: 30

Where each of these is a different cell relating to date. So what I’d first want to do is get the name of that field, how would I store it as an output to increment then post back to that date?

(Kellsey Shaw) #6

Hi Joe,

You would use Collections Outputs that will show you the friendly name in the outputs list so that you don’t need to worry about the references :slight_smile:

(Joe Hatch) #7

So I’m looking up the row by the name, returning a list of every item in that list, for instance the row JOE TEST has the following output:
Content
leadvolume: JOE TEST, _cokwr: 0, _cpzh4: 0, _cre1l: 0, _chk2m: 0, _ciyn3: 0, _ckd7g: 0, _clrrx: 0, _cyevm: 0, _cztg3: 0, _d180g: 0, _d2mkx: 0, _cssly: 0, _cu76f: 0, _cvlqs: 0, _cx0b9: 0, _d9ney: 0, _db1zf: 0, _dcgjs: 0, _ddv49: 0, _d415a: 0, _d5fpr: 9, _d6ua4: 0, _d88ul: 0, _dkvya: 0, _dmair: 0, _dnp34: 0, _dp3nl: 0, _df9om: 0, _dgo93: 0, _di2tg: 0, nov: 0

Where are values, except _d5fpr: 9, are 0.

Then I have an input that receives a time/date stamp, formats it to {dd}-{Mon} in the format date field, so the test lead I just put in is 21-Nov.

This matches the output for d5fpr: which is outputting 9. So I want to only update the 21-Nov field, created a code service using the output of the date,
Inputs:
date {{date_time_format_date.date}} // this is the formatted date output collection
twentyone {{look_up_row_by_vertical.gsx:21nov}} //the result of row lookup, column title 21st november

Code
var date = inputs.date;
var twentyone = inputs.twentyone;

if (date == "21-Nov") {
  resolve(twentyone);
}
Inputs
{
  "date": "21-Nov",
  "twentyone": ""
}

But it’s not picking up the value. It’s returning blank rather than the expected 9.

Using the value, i then have another code service to take that output, add one and return it:
var currentLeads = inputs.currentLeads;
currentLeads++
resolve(currentLeads);

so in theory it should work if the 9 was being picked up because currently it’s only returning 1 (0+1).

(Kellsey Shaw) #8

Hi Joe,

There might be an easier way to do this. Could you share your flow and sheet with me via email so that I can take a look and see if we can’t do something simpler and easier to follow :slight_smile: