Creating a Type can be a tedious process if it is quite big and elaborate. Luckily Linx has the Import types feature, making it easy to create Types from a JSON or XML object.
To quickly create a type for the output of your SQL statement, you can follow these steps:
- Drag a new ExecuteSQL function into your function and configure it to connect to your Database
- List item Add your SQL query
- Add a string underneath the query execution
- Assign the output value of the ExecuteSQL function to the String
- Add a breakpoint to where the String is
- Debug the solution until after the String has been assigned
- Copy the value assigned to the String (this will be a JSON object)
- Stop debugging and delete the String
- Either: right-click on a folder OR go to the menu > Solution > Import Type
- Give your type a name and paste the copied JSON object into the text box
- Create your type and use it as required.