Tap Field to add variables: other fields added to this Library. Write the lines of code in Script panel. From the toolbar on the right from Field option, you can Run the script using the data of any chosen entry to test it or get Help.
On the screenshot above, there is a small script that computes the Importance of the Purchase based on the Category of the purchased product. It is as easy as:
if (field(“Category”) == “Food”) ‘Yes’; else ‘No’;
The detailed information and several useful examples can be found on the wiki.