This article will describe the steps to take if the application does not work as expected (wrong result is obtained / data is not updated).
Business process flows and connections
Make sure that the business process responsible for sending the request to the server is configured correctly.
Consider an example when the business process triggers on a button's click. So, it is important to check that the BP starts with the onClick trigger.
Also it is important to see that the connectors are all set between the business-processes and the Component ID is specified.
In addition, to make sure that the BP goes to a certain step in its execution, you can use Write to log and Show notification or Show toast blocks. Thus, you can track its flow and see at which block the process does not work or works with an error.
When using Write to log in web applications, the message will be displayed in the developer tool console (F12 in the Google Chrome browser).
Server request problem
Make sure the request actually goes to the server. To do this you need to switch to developer mode (F12) in the published application. All requests will be visible in the Network tab. You can check not only the fact of the request, but also check all the details of it. In the Payloads tab you can see the request parameters.
The server’s response can be found in Preview tab.
Request payload errors
If the request is sent and the triggers are configured correctly, then it is worth checking if there are errors in the request itself. It may be that incorrect parameters were provided (or weren’t provided at all). This can be checked in the Network tab and in the Payload tab you can check that exactly what was intended is transmitted.
If there are any doubts about the correctness of the request, then you need to start from #1 and put the Show Notification and Write To Log blocks in “weak” places, identifying errors in the business process.
Error is somewhere else
The button is pressed, the request is correct, there are no errors, but it still does not work. What is wrong then? It may be that the desired result is not searched where you are looking for it. For example, you add a record to a table and it is actually added, but the result is not visible, because the data update process in this table is not configured properly. The best option is to check the process flow in the Swagger. It can be found in the Preview dropdown in the Project API section. This is a great tool that is created in every application in AppMaster. In fact, this is an automatically generated documentation for the application. It is possible to test all Endpoints, test all possible actions, and see them in practice. For example, you can send a request with the required parameters and get the result of this request.
Using logs
Perhaps there are errors in the process itself? The business processes are often quite complex. Lots of blocks, different conditions, checks, branches, loops. In this case, in addition to the Notification and Toast blocks, which can help you see the error on the front, it is reasonable to take care of the logs. You can use both a pre-created Write to log block and once you have the logging being set up you can find out what went wrong.
If you are still experiencing issues after all the steps above then you probably found a new bug which we (AppMaster Team) are not aware of. Reach out to us to let us fix the issue. Please provide the most comprehensive information: screenshots, detailed description of the problem and request examples, as well as Trace-ID.