Reputation: 1
There is something (probably simple) I am missing here. I am trying to create a Data Source in Google App Maker that queries an SQL database. I want to have a WHERE
clause that uses an email address. I have set up the email
property but, for the life of me, I can't figure out where you assign a value to that property. Do you do it in a server side script? The Data Source loads when the page loads - so it needs to assign this value on load.
Interface screenshot:
Upvotes: 0
Views: 934
Reputation:
Try using datasource query filters instead, I was looking to do the same thing via SQL queries.
The cleanest way to do this is probably query filtering.
Datasource query filtering works like SQL queries (but simplified, and works with SQL databases)
I am using a Google Cloud SQL database, but I believe the same method will work for any datasource.
You can make a custom property or bind the query to any value on a page and reload the datasource if needed to update programmatically.
Set the datasource of a table or another widget to your queried datasource to get the results.
That's how I know to create search functions within appmaker.
Hope that helps
Upvotes: 1
Reputation: 1974
your sql is correct, just add input with value binding @datasource.query.parameters.theEmail
and update event "onValueChange" -> "Reload DataSource", or set parameter manually and reload datasource:
app.datasources.getEventData.query.parameters.theEmail = '[email protected]';
app.datasources.getEventData.load();
Upvotes: 0