In the Profound.js low-code environment, much of the functionality can be created without writing any code.
Writing Server-side Code
If you need to write code for the start of a condition or loop that will encompass other steps, select the “Node.js Loop/Condition Partial”.
As you’re writing code, you can insert references from the low-code environment by clicking on the Insert Dynamic Data icon.
Work variables can be referred to directly by name in your code.
Screen fields can be referenced using the following syntax:
Global properties can be accessed by using the following format:
Writing Client-side Code
If the entire routine is custom code, it may be easier to just write the code directly in the widget event property, rather than creating a routine.
Converting Existing Steps to Code
You can convert any existing low-code step to code by clicking the JS icon on the action dialog.
You can then customize the code and save your changes.
The Profound.js low-code environment will analyze the code you write in order to provide future suggestions for work variables and global properties. Only outer-level declarations will be analyzed. For example, if you write this line of code:
var maxRecords = 10;
Profound.js may start suggesting maxRecords as a value for answers to other low-code plugins.
Convert a Routine to Code
In addition to converting individual steps to code, you can also convert an entire routine to code. This is done by clicking the "Switch routine to Node.js code" icon. Client-side steps are not converted as part of this process.
When you do this, the routine will have to be maintained manually with code going forward.
Viewing the Entire Program as Code
You can view or export the auto-generated code for the entire application from the Logic tab by clicking on the corresponding toolbar icon.
The application will then be translated to Node.js.
This can be useful in gaining an understanding of how low-code applications are structured and will help you in writing your custom routine steps.
Have questions about this topic? Ask for help on our Profound.js Spaces Discussion Forum.