** I have removed the table and cell references to maintain proprietary security **
{{SERVICE}} or ${T} : Service Logging Table
{{VIN}} or ${T}: VIN Logging Table
{{CELL}} or ${C}: Referenced Cell
I've been struggling with performance issues due to using a spreadsheet formula that makes an API call to the NHTSA database to retrieve VIN information on a vehicle and populates in the app to provide techs in the field with vin decoding services used in automotive diagnostics, invoice document generation, as well as automated email to our clients.
The current system is working as designed but I did not account for the cost of processing using spreadsheet formulas opposed to virtual columns and AppSheet formulas.
Everything works fine until {{VIN}} reaches about [50] rows or so then the {{VIN}} bottlenecks and the API formulas populate {{CELL}} with "Loading..." on random rows of {{VIN}} causing blank output in the app due to every time one of our (8) technicians are actively syncing the app, multiple times a day, the spreadsheet formula is calling out (50) VIN#'s every sync and if (3) techs sync at the same time that's (150) api calls at once being made to the API causing cells in {{VIN}} not populate or display the Return Response in the Sheet or the App.
I setup a bot to delete finalized tickets once a week to maintain the sheets to stay around (50) rows but when the lines are deleted from {{SERVICE}} it deletes the {{CELL}} formulas as well and the AutoFill feature creates a referencing nightmare due to it not updating the cell references to append from to the new order of the rows.
Convert the formulas from the sheet over to AppSheet to gain event, process, and action control features and would also reduce bottleneck effect on performance reducing sync time and dev support.
Find an App Script function that can be called to accommodate the API Call and Return the .csv values from the API response by appending the results to {{VIN}} and using AppSheet reference formulas to display in the app.
I've been trying to convert a known working formula from Google Sheets formula syntax to perform the same action using AppSheet formula syntax but i cant seem to get the correct expression method combination correct.
I use a mirror column to keep {{VIN}} in sync with {{SERVICE}} so that any time a row is deleted or finalized and/or archived it will remove the row from {{SERVICE}} and the row with matching [_row_number] from {{VIN}}.
[START]
EVENT: A VIN Barcode is scanned in the app using form and Submitted
PROCESS:
Any help or direction on converting, and/or provisioning, an economical workaround would be greatly appreciated.
=IF(NOT(ISBLANK(${T}!${C}), QUERY(IMPORTDATA("https://vpic.nhtsa.dot.gov/api/vehicles/decodevinvalues/" & ${T}!${C} & "?format=csv"), "SELECT * OFFSET 1", 0), "")
IF(NOT(ISBLANK(${T}!RC[8])), QUERY(IMPORTDATA("https://vpic.nhtsa.dot.gov/api/vehicles/decodevinvalues/" & ${T}!RC[8] & "?format=csv"), "SELECT * OFFSET 1", 0), "")
Requesting Sheets => AppSheet Formula Conversion
=ARRAY_CONSTRAIN(ARRAYFORMULA(IF(NOT(ISBLANK(${T}!${C})), ROW(${C})-1, "")), 1, 1)
=ArrayFormula(IF(NOT(ISBLANK(${T}!RC[9])), ROW(RC)-1, ""))
Requesting Sheets => AppSheet Formula Conversion
=IF(NOT(ISBLANK(${T}!${C})),CELL("CONTENTS", ${T}!${C}), "")
// Service Table columns using append formulas
// VIN Table appended reference columns
// Appended entity relation
APPENDVINFO(VINDecoder!RC[-7]),//[VID] (Ref)
APPENDVINFO(VINDecoder!RC[-7]),//[VinID] (Number)
APPENDVINFO(VINDecoder!RC[16]),//[Year] (Number)
APPENDVINFO(VINDecoder!RC[12]),//[Make] (Text)
APPENDVINFO(VINDecoder!RC[13])//[Model] (Text)
Apologies. I apparently was in tips & tricks when i should have posted in QA. Here is the link to this post in QA
Request Assistance Converting Spreadsheet Formulas... - Google Cloud Community
User | Count |
---|---|
16 | |
10 | |
8 | |
5 | |
5 |