We have a workflow, which works correctly when ran in the workflow environment. The workflow is designed to send data from one table to another in the correct format in the Retool database.
We currently have a table within an app which shows data from this first table, alongside a button with the workflow attached as an event handler.
The issue we have is; when clicking the button we either get no result (query runs successfully) or all data in the table is submitted. We want to submit the selected rows only. We think its due to the workflow parameters within the app but have had no luck with correcting. Attached are some images from the workflow and query.
Is it possible that sometimes the array is empty or null and that this effects your query?
In case you do receive “selectedRows” and it’s not empty/null.. could it be that the type is wrong and it’s not really [817,818]. Is it perhaps a string you receive?
I didn’t see that either. When I don’t see it I just copy the code into ChatGPT and see if it sees something I did not. It helped a couple of times and saves time. Especially if it’s something small like this. Sometimes I start over from a different angle which is a waste of time if it’s something like this. happens to all of us I guess.
One quick way to check you have a valid object is to look whether the result when you are setting up the workflow parameters renders as an Object or a string: