Modifying data structures is a routine part of OutSystems development. However, when you change the output structure of an SQL query—especially by adding, removing, or updating attributes—you risk breaking your SQL if you’re not careful. Here’s a practical walkthrough from Senior Developer Elizabeth Sumalde on how to avoid these issues and keep your applications running smoothly.
Imagine you have a screen displaying open tickets, powered by a block with an SQL query. The output structure includes several attributes, such as ModifiedOn. Suppose you decide ModifiedOn is no longer relevant and remove it from the structure.
After publishing this change, you might expect everything to work—but instead, you find your SQL code is broken.
When you remove an attribute from the output structure but don’t update your SQL query, the query still tries to select the now-missing attribute. OutSystems attempts to map the returned columns to the structure’s attributes in order, leading to:
This is easy to spot if you only have a few warnings, but in larger apps with many warnings, it can be tricky to identify the root cause.
Before making changes to any output structure, follow these steps:
By following these best practices, you can confidently manage OutSystems SQL changing structure and keep your applications robust and error-free.
Want to learn more valuable Dev Tips? Sign up for our newsletter and stay updated with the latest insights! Also, don’t forget to check out our upcoming OutSystems courses to scale your career.