-
My goal: I would like to bulk update several components in my google sheet. To achieve that I want to select multiple rows in a custom collection and update only the selected values in the google sheet data source.
-
Issue: I had a discussion with ChatGPT to solve that problem and I think some of the suggested solutions were absolutely going in the right direction, but some aren't working at all. I tried several hours to get a list of all selected checkboxes of a custom component.
-
Steps I've taken so far:
These are the steps I've taken so far only to generate the list for the bulk update:
- added a column in the original data source to set the selected value of the custom collection (true or false)
- Saved the google sheet query in a variable
- get the variable in the custom collection
- added a checkbox in the custom collection
- added change handler for checkbox press
- Added a script in the change handler ChatGPT suggested (didn't work)
That's the script:
const backlog = utils.getVariable('Backlog');
const index = i;
const newValue = 'true';
const updated = [...backlog];
updated[index] = {
...updated[index],
Selected: newValue
};
utils.setVariable('Backlog', updated);
How do I change the value in the variable after pressing the checkbox?
Maybe there is a better solution to solve the problem. That is only the way ChatGPT suggested.
To bulk update I only need the ID (also a value in the existing google sheet) of the selected entries. I would filter the variable and look for the selected value.
- Additional info: (Cloud or Self-hosted, Screenshots) Cloud hosted