google-apps-script - Auto-fill custom function
问题描述
So in my Google Sheet I have a custom function that just gets values from a json file. I'm trying to auto-fill 1 value in this function, but it doesn't work. I'm trying to achieve this:
=IMPORTJSON("example.json","1/value")
=IMPORTJSON("example.json","2/value")
=IMPORTJSON("example.json","3/value")
I would want it to autocomplete to 3,4,5 etc but it just repeats 1,2,3. I tried to put 1,2,3 in a separate cell then auto-fill those cells and just reference the cell in the function, but that doesn't work. Help much appreciated.
解决方案
使用 ROW() 和 & 运算符
=IMPORTJSON("example.json",ROW()&"/value")
ROW() 返回行号。如果您需要偏移量,假设您需要=IMPORTJSON("example.json","1/value")
第 2 行,然后使用
=IMPORTJSON("example.json",(ROW()-1)&"/value")
推荐阅读
- python - 由于缺少 TLS CA 证书,PyInstaller 包执行失败
- discord.js - 如何从 Discord.js 中的消息中删除文件?
- python - 在 tensorflow.python.data.ops.dataset_ops.BatchDataset 中找到最大值
- java - Microsoft Graph 和 Java - 针对授权代码流的多次调用
- python - 将实例传递给对象与稍后将实例作为属性添加
- c# - 是否可以遍历 word 文档并获取所有日期?
- python - Python pandas 使用 3 列分组
- python - 熊猫数据框与列 dayofweek 和 time 作为键合并
- postgresql - docker-compose psql 不在 127.0.0.1 上提供服务
- arrays - 在 C 中,如何打印用户选择输入的值的索引?