Jump to content

NEED HELP Writing Javascript That Reads, Finds, Updates


JMareel

Recommended Posts

Hello everyone and long time no see.  I need help with coding again and have been searching and learning quite a bit but just can't seem to piece it together because I've never played with javascript.  Can someone help me please?

Here's the scenario.  I have a Google Sheets workbook with a few sheets.  First sheet is a dashboard for the user to enter data into a table.  The other two sheets contain the data being accessed and manipulated by what is entered by the user in the dashboard once the CHECKOUT button is pressed.  The javascript would be executed once the CHECKOUT button is pressed.

I need the javascript to

1) read the user input data (text which I guess would be called strings) from the table in Dashboard sheet.  User inputs the text name of an item in cell D7 and a number quantity in E7.

2) search the Inventory sheet for what was input in Dashboard sheet cell D7 and get the value of that items current amount.

3) Add or subtract the value of what was input in Dashboard sheet cell E7 with the item's current amount in Inventory sheet.  Addition/Subtraction is determined if the checkbox is checked/unchecked in Dashboard sheet cell C7.

4) Update the new item's amount in the Inventory sheet.

 

EXAMPLE:

1) User inputs in Dashboard sheet D7 "Apples" and in E7 "8"

2) CHECKOUT button is pressed.

3) Javascript searches Inventory sheet for "Apples" and finds its current amount is "10".

4) 8 is added or subtracted to 10.

5) New value of 18 or 2 is then updated in Inventory sheet for "Apples".

 

Thank you to any and all that can help us find a solution because its been about a week we've been wrestling with this.

Regards,

JM

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...