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

2020-12-07 17-35-54
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.*
UserImage.jpg
Craig Merchant
Antonio, for at least 45 minutes today, you are my total hero.  

Thank you!
2020-12-18 16-38-57
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 GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.