Hello, I made a custom widget which displays the current selected table in a HTML page. The function I’m using is:
<script src="https://docs.getgrist.com/grist-plugin-api.js"></script>
grist.onRecords(function (records) { ... });
Everything works perfectly.
But if I need to retrieve data from some other table how do I achieve that? Is this possible and what function should I use?
jperon
August 31, 2023, 12:38pm
2
Hello,
It’s possible by using fetchTable (which requires full access to document). You have an example in the “Inspect API” custom widget.
perfect. I tried it and it works (obviously). thx
oops, just one more thing.
if I need to update a field of a specific record of another table what function should I use?
1 Like
it doesn´t allow fetching data from another DOCUMENT however, does it?
jperon
August 31, 2023, 9:15pm
6
@Alfredo_Ardito
if I need to update a field of a specific record of another table what function should I use?
applyUserActions . You have some examples in grist-widget repository .
jperon
August 31, 2023, 9:16pm
7
@Rogerio_Penna
Not that I know. I didn’t ever do this, so I don’t know whether/how it would be possible.
Sao
September 15, 2023, 4:25pm
8
is there a way to return not all the table but with a filter ?
jperon
September 15, 2023, 4:27pm
9
It’s a good question, that I thought I’d ask once I’d have finished my current tasks…
1 Like
Good question too. Obviously filtering means sorting ascending and descending and with a WHERE Clause. Things would a lot easier if we could use SQL statements to query data.
jperon
September 16, 2023, 8:45pm
11