Debug Server Action Values in NodeJS


I’m quite new to wappler and nodeJS and I’m note sure how to debug or test my application. I know there are already a lot of topics around this (eg Best way of debugging code/queries) and I know how to activate debug mode and see the errors.
But to really understand what it going on, I need to see the values.

Lets take this example (There is no error, but it’s easy to show:

I have nested repeats that first get data from my db, for each values I make an API call and for each API-response I replace values in my DB.

If I run the query, I can see all the steps in my local server console -> but only with placeholders like {{company_slug}}, [Object], [Array]. I have have no idea at what row/data-set the workflow currently is. And if i get an error like " {{items}} is not an array", I have an idea what the problem is, but I need to know what the actual value of {{items}} was or what the last API-response was to know WHY this {{items}} is not an array, when all the other {{items}} before where.

Before wappler, I was using a lot of print_r($xxx); or console.log(xxx) while testing to see the values. How can I do similar with wappler?

I typically use the browser developer console to troubleshoot.

First, I check the console for any errors or warnings.

Next, on the network panel, find the relevant server connect and check the headers tab to confirm the server connect is calling the api you think it is, the method, query parameters, etc. And the payload tab will show you which values were sent via POST from the client to the API. And the preview tab will show you any actions in the api with the output option ticked.

If that isn’t enough, I start throwing in temporary Set Value actions with output on to track down exactly where something went wrong. This being similar to the console.log approach. I typically name these set value actions prefixed with tmp so I know they can be disabled or removed when finished.

Perhaps there is a feature request in here that can make this debugging easier!

I tried the setValue with output, but the id still is not showing.

By browser developer console, I mean use the developer console that is found in your browser (chrome, firefox, safari, etc.). You are showing the debug within the editor.

1 Like

This is what @mebeingken means: