Help Optimizing piston for newbie


#1

1) Give a description of the problem
Hi all! I am a newbie, so please be patient. I’ve spent too much time on the below piston. The general idea is that I can say to google home "give ‘child 1’ and ‘child 2’ 12 points. We use a point system in the house. IFTTT parses the names and the values and passes it to webcore. From there, I identify which child gets or uses points, does the math and logs it to a google sheet.
The redacted areas are to protect my children’s names, the path to the spreadsheet and part of the code which is the same as the first half, but it just subtracts points instead of adds them.

2) What is the expected behavior?
I’m expecting the logging process to not take 2 seconds each and that each child’s code starts and runs independent, since I set it to asynchronous for those if statements.

3) What is happening/not happening?
The google sheets code takes too long. I would like help optimizing this code to make it as fast as possible and not as long.

**4) Post a Green Snapshot of the piston!

5) Attach any logs (From ST IDE and by turning logging level to Full)
For now, let’s not upload logs, as I want to refrain using my kid’s names.

Thanks!