on ‎2024 Jan 02 2:16 AM
Hi,
Would like to ask if someone here has already used the JavaScript function in SAP Build Apps? I am new to Java Scripting and would like to see a guide on how to use this function as well as on what test cases can this be used.
Thank you
Request clarification before answering.
You drag the flow function JavaScript into your logic flow.

If you double-click, you get the JavaScript editor.
In the following, I have defined on the left a single input (which I can hardcode, set to a formula or variable), and 2 outputs on the right. Each output can provide a set of properties that can be passed to the following flow functions, just like Get record collection flow function will output a list of data.

The return statement will return an object, which is the default type for each output, though you can change this. If you have multiple outputs, you return a list, where the first item is a number indicating which output (starting with 0), and then the object.
More documentation: https://docs.appgyver.com/docs/custom-javascript
Just this week joe.binkley published a blog where he uses JavaScript to avoid a more complex flow function in his Tic-Tac-Toe game – https://groups.community.sap.com/t5/sap-builders-blog-posts/tic-tac-toe/ba-p/309372
Others use it to do things not available in other flow functions, like making HTTP calls or other JavaScript functions not exposed in the formula editor.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.