I am trying to use a SuggestBox on a Calculated Table. I am able to see the values, however the results are not filtered based on the value I type in the field. Is there a limitation with its used on Calculated tables?
Thanks,
Maria.
Currently App Maker filters data automatically when SuggestBox in "Use specified field as value" mode only.
In "Use whole record as value" mode query parameter supplied to the Calculated Model script has startsWith filter for the Field which the script should respect.
This filter can be mapped to underlying DB query or processed in code like:
var records = ...records generation code...;
var prefix = query.filters.FIELDNAME._startsWith.toLowerCase();
return records.filter(function(record){
return record.FIELDNAME.toLowerCase().lastIndexOf(prefix, 0) === 0;
});
It is so for performance reasons, but I'll consider to improve documentation and add an automatic results filtering option.
Related
I saw that on the Hasura documentation you can transform an insert conflict into an update statement (upsert) by using the on_conflict property.
This works well but in our case, we send an array of objects (which are equivalent to a table row) in the GraphQL query, and I would only like to do the update if a certain object attribute has changed. Here is an example of what we would like to do (the syntax is made up):
on_conflict: {
constraint: degrees_key,
update_columns: [completion_year],
where: {
completion_year: { _neq: submitted_completion_year }
}
}
So in this example, you would have a table with a degree where you would only update the completion year. We would only allow updates on this column using permissions. Right now the way we achieve this is by filtering existing rows before we do the inserts.
By being able to check if the completion_year is not the same, we could let the server do the filtering. Meaning we send all the rows to Hasura and if the field completion_year is the same, then we would ignore that row. It would actually be better to do this verification server side than client side.
Is there a way to do this? I could not find any example where the filter clause would refer back to the values being in conflict.
I'm making a report in Data Studio using my Analytics data, and I'm having some trouble finding out how to filter it. Here is what I need to do:
I receive a "user" parameter in the URL, and I need to filter my "username" dimension with it. I want to make some kind of filter in the report, like Include usernameDimension = userParameter.
For some limitation in DataStudio, currently it is not possible to directly use Report URL parameters for filtering reports (when you create a filter, it only allows you to select fields, not parameters). However, it is possible to 'hack' this limitation with a new field that references the parameter.
Create a new boolean field called my_filter (or something you wish) with this expression:
field_i_want_to_filter = my_parameter
Then, just create a new filter in your report using this field, with the condition my_filter is true.
I can create a custom field to extract the username using a regular expressions.
Suppose you have a field called URL that contains something like:
https://example.com/path/path/endpoint?param1=blah¶m2=bleh&username=Diego¶m3=blih
You can use this formula in a new field to extract the username:
REGEXP_EXTRACT(URL, "[?&]username=([^&]*)")
You can easily add this custom field to a Drop down selector or something to allow filtering in your dashboard.
I'm building an app using React + Redux + Firebase. In Firestore users collection, I have multiple fields including language, subject as map data. So for example,
// language that user can speak
language = {
english: true
}
// subjects that the user can teach
subject = {
math: true
science: true
}
In the main app, user can search other users by filtering subjects and languages. For example, user may look for the other users who can teach 'math' and 'science' using an 'english' language.
And I'm struggling with filtering multiple fields in map data. I could query for on field by doing ref.where('subject.${val}', '==' , true). But is there any way to query on multiple fields to get a document which contains a subject hash at any given number of subjects?
I tried to put data in array but currently firebase Array membership only support filtering one item in the array. So I guess it's a good start with storing in hash map. Any suggestion?
I tried to put data in array but currently firebase Array membership only support filtering one item in the array.
You're right, you can filter your items only by a single item that exist in an array. If you'll chain more than one function call, you'll get an error similar with this:
Invalid Query. Queries only support having a single array-contains filter.
And to answer your question:
But is there any way to query on multiple fields to get a document which contains a subject hash at any given number of subjects?
Unfortunately, there are no wildcards in Firestore. You have to identify the property names of your documents by their exact property name.
If you want to limit the results by filtering on multiple properties, you need to chain where() functions, like in the following example:
ref.where('subject.math', '==' , true)
.where('subject.science', '==' , true)
.where('language.english', '==' , true)
I'm currently working on generating a set of reports and dashboards based on a set of data within our mysql database.
I've created a few custom procedures that take a date input and give all the results as required.
Unfortunately, when I point to these procedures within "data sources", I'm unable to dynamically change the Date parameter - once I set it within Data Source, it's stuck as that date forever (unless I edit the report/dashboard).
Does anyone know of any way you can change the query based on a users input?
I've tried creating parameters which match the name of the parameter set within the query at "Data Source", but have been unable to "inject" the date to use.
Any help would be greatly appreciated!
Check the "Filter a SQL Query" section of this documentation topic https://docs.devexpress.com/ReportServer/118944/create-dashboards/add-a-dashboard-parameter-and-filter-data
Briefly, you need to create a dashboard/report parameter and bound it to the data source's query parameter via expression.
I have created one datasource which contains only the rows that fulfil one condition. I want to create some filters in this table... but is not working.
This is the datasource:
For example, I have a text area which filters by the field "Title". Only should appears the row 5 , but the numer 6 it's still here...
This is the event handler code:
Important: in the beginning, I used this filters and they worked properly. They stopped working when i created the filter in the datasource (The one of the first image)
The filter that you are setting via the binding is getting lost when you perform your query script. Essentially, you are creating a query via the binding, then your script is creating a new query that doesn't have the filters you set previously.
Server Script - queryRecords(query: Query)
You'll notice that your query script has access to a parameter query that you can use instead of calling newQuery(). This will have the filter you set via your binding. Additionally, query.run() returns a list of records, so there's no need to iterate over them. Here is all the code you need in your query script:
query.filters.Status._in = ["Published"];
return query.run();