Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Craig Merchant
1
Views
3
Comments
How do I set a default value to the result of a SELECT query?
Question
I've created an advanced query and successfuly had it populate a structure on a web page. I would like that table to have the same look, feel, and functionality as an entity dragged from Data section. I'm trying to figure out how to deal with the Boolean structure that is created for the check boxes that are used for the Delete command. I can drag a Boolean structure to the Advanced Query, but I don't know how to populate it with a default "false" value.
If I simply drag it to the Advanced Query and test it, I get: Error in advanced query GetApplicationsByMachineID: Could not assign " to 'Boolean.Value'... Index was outside the bounds of the array.
Thx.
Craig
António Chinita
Hi Craig,
just add ",0" to the beginning or end of your select list (depends on the Output structures order in the query)
Example:
SELECT Table1.*
, 0
or
SELECT
0,
Table1.*
Craig Merchant
Antonio, for at least 45 minutes today, you are my total hero.
Thank you!
Carlos Rocha
Hi Craig,
Antonio told you how to do it, just for your iinformation if you want to add a default value to a column filled from a table you can use the function COALESCE
select COALESCE ({entity}.[atribute], 0) from {entity}
if you want to know more about coalesce function chek this
https://msdn.microsoft.com/en-us/library/ms190349.aspx
Regards,
Carlos Rocha
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...