Issue with calling Workflow

Hi All,

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.

Any help would be appreciated.


image
Updated correct start trigger, but still no success:
image

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?

Hi @Steven_W,

Thank you for the reply. As far as I'm aware, the array is not empty. I have attached an image;

error log;

can you expand the start trigger data and upload a screenshot?

Would formatDataAsArray() help?

Hi @Steven_W ;

Attached as requested;

Where would I use formatDataAsArray()? Sorry, non-developer here....

Hi,

Found the issue; a pesky } missing in the workflow parameters! :sob:

image

That's a couple of days that have definitely not been wasted. :smiling_face_with_tear:

Sorry to waste your time!

1 Like

:smiling_face_with_tear: 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. :sweat_smile: 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:

Missing } in parameters:
image

Properly formed parameters:
image

2 Likes