dongwenhui8900 2016-01-14 16:21 采纳率: 0%
浏览 49

尝试使用PHP或Javascript从Google表格中提取值

I have a Google Sheets spreadsheet containing product inventory. 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. (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.)

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:

  • CSV only lets me access the first sheet in the document
  • XLSX isn't readable by the PHP class I tried using (excel_reader.php, which I use for other things and is otherwise perfect but I guess can only read XLS, not XLSX)
  • ODS has its own PHP class as well, but it seems overly complex and unwieldy for what I'm trying to do

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." I'm really hoping there's a (fairly) simple way to do this...

  • 写回答

1条回答 默认 最新

  • dongyong5255 2016-01-14 16:52
    关注

    I recommend using this 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".

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?