[英]Trying to pull values from a Google Sheet using PHP or Javascript
I have a Google Sheets spreadsheet containing product inventory. 我有一个包含产品库存的Google表格电子表格。 There are multiple sheets within the document, each sheet containing products of a particular brand. 文档中有多张纸,每张纸都包含特定品牌的产品。 The two important columns in each sheet that I'd like to be able to work with are Part Number, and Quantity. 我希望能够使用的每个工作表中的两个重要列是零件号和数量。
What I want to be able to do in my web app is, given a particular part number and brand name, look up the corresponding quantity in the correct sheet in my Google Sheets document, and send that value back to to the web app to display. 我想要在网络应用程序中执行的操作是,给定特定的部件号和品牌名称,在我的Google表格文档中的正确工作表中查找相应的数量,然后将该值发送回网络应用程序以进行显示。 (Essentially, I want the web app user to be able to click on a part number, and get the current quantity of that item displayed next to it.) (本质上,我希望Web应用程序用户能够单击部件号,并获取显示在其旁边的该项目的当前数量。)
I've tried publishing the Google Sheets document to the web, and accessing it in PHP as several of the formats Google offers (csv, xlsx, and ods) and have hit a wall in each instance: 我尝试过将Google表格文档发布到网络上,并以PHP的形式使用Google提供的几种格式(csv,xlsx和ods)进行访问,但在每种情况下都遇到了麻烦:
I don't need to modify the Google Sheet in any way with this... all I need to do is go, "Given brand X and part number Y, return the value in the Quantity column of this Google Sheet." 我不需要以此方式进行任何修改。我要做的就是,“给出品牌X和部件号Y,在此Google表格的数量列中返回值”。 I'm really hoping there's a (fairly) simple way to do this... 我真的希望有一种(相当)简单的方法来做到这一点...
I recommend using this Google Spreadsheets Client API . 我建议使用此Google Spreadsheets Client API 。
It makes the dirty work quite simple and provides a relatively easy-to-use interface so you can work with your spreadsheets without "workarounds". 它使肮脏的工作变得非常简单,并提供了一个相对易于使用的界面,因此您可以使用电子表格而无需“替代方法”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.