Datas studio community connector: getData is called twice and fields list = null - google-data-studio

I've made a community connector getting my data from Bigquery, and in one specific case, the gatData function is called twice and one of the call does not send fields
This occured when in a dashboard :
I make a table chart: getData is called once, all is OK
And just toggle "Show summary row" to True: see my screenshot in attachment, getData is called twice and fields equals to null
here is my screenshot
Is anyone can explain me if it's a bug or if I'm doing something wrong.
With many thanks.
Elodie.

This is a known issue that stems from compatibility with connectors other than community connectors. Usually a separate getData call is made for Summary fields in those cases.
This issue should get resolved in future. For the time being, the recommendation is to return a blank data object for getData calls with a blank field list.

Related

Reactive search Datasearch Show suggestions with default Query and/or custom query, only getting results on the first character

I have a reactive search Datasearch component that is running a default Query in order to exclude some results based on an Id. If I use the Datasearch without a default query, I am getting the suggestions just fine. But whenever I add the default query I can see the correct suggestions on the first character but after that it stops giving any suggestions.
I have been looking around in the render rawData and data variables. And I can see there are still rawData vars, but the Data input stops after the first hit. In addition, When I add a custom query, it seems that the suggestions do not really take this in account as it still shows suggestions outside of the subset created by the query.
My question is now, How to get the default query and custom query to work together with suggestions?
It seems that all the other components work correctly with my default query as in only showing results in the subset created by the custom query
Would be really helpful if someone could point me in the right direction on this one, Thanks in advance.
Update:
I want to add that when I look in the stateProvided object. Whenever I add the defaultQuery. The stateprovider stop showing the SearchState after one character in the searchbox. It seems like it's completely blocking the normal behaviour

How to store Array for new field type extention in Bolt cms

I am working on an extension to replace the select field type with radio/check boxes in Bolt cms. My problem is how to use bolt internals to store selected values.
Ajax POST data when I press save:
day[]: Monday
day[]: Friday
So this is the same as for select fields.
I followed this tutorial: https://docs.bolt.cm/extensions/customfields
and used
public function getStorageType(){
return 'text';
}
The response of the ajax-save request for this field is Array and this is what gets into the database. Interestingly select fields does not appear in this response. I can not find the place where data of select-fields are stored in app-code.
How can I store it correctly into database?
Using getStorageType 'json-array' results in wrong database scheme which bolt is not able to solve.
You can have a look on the code here:
https://github.com/osfriese/bolt-boxselect/tree/develope
Please help. Thanks
Tobi
I found the solution - more or less.
Sadly it is hardcoded in src/Content.php.
If you want a custom fieltype wich stores array values you have to change the select case in function getValues to:
default:
if (is_array($this->values[$field])) {
$newvalue[$field] = json_encode($this->values[$field]);
}else{
$newvalue[$field] = $this->values[$field];
}
break;
And in setValues there is a $serializedFieldTypes = array(...) where you have to manual add your custom field type.
Sadly this is not practical for extentions. But I will update my github with my changed Content.php for people who want to have a look.
When I was searching for an solution I reviewed a lot of source code of bolt master branch at github. For version 2.3 the storage layer is completely rebuild and as it seems there will be no need for any changes than. So hopefully with version >=2.3 the extention will work out of the box.
Nevertheless getStorageType() just just affect database field type and bolt just accepts 'text' here.
Hope I can help some people by answering my own question.
Thanks
Tobi

Where are the dummy collaborators in in-memory documents?

The documentation suggests that there would be dummy data populating the results from calling getCollaborators, although it does not give any details about what the dummy data would look like.
My calls to getCollaborators return an empty list. It would be quite helpful to populate the list with one dummy collaborator which isMe so that I don't have to check document.isInGoogleDrive all the time.
This has been added to the API. It should be available in about a week.

How to get a value from a combobox in a form after the field is populated by the database

I have a formPanel with two of the form items as comboboxes with their stores populated by the database. The value from comboBoxA needs to be used to get the value for comboBoxB however comboBoxA.getValue() (as well as getRawValue()) are returning undefined.
storeA.load();
var comboBoxA = Ext.getCmp(comboBoxAID);
storeB.baseParams.UserID = comboBoxA.getValue();
storeB.load();
As noted in the docs, store loading is asynchronous, so you have to do your additional processing within the appropriate callback:
storeA.on('load', function(){
var comboBoxA = Ext.getCmp(comboBoxAID);
storeB.baseParams.UserID = comboBoxA.getValue();
storeB.load();
});
storeA.load();
Loading a ComboBoxes store does not actually select a value. Try making a selection first (or loading a record into the form, etc). It sounds like your trying to link the 2 combos. If thats the case, search around for a tutorial, there are few out there. This should get you started, Linked Combos.
You might want to try this. It might be exactly what you are looking for. It also has a demo on the same page. The page is in german but the demo is predictable and the code is in english so test this.

How can I retrieve latest from database using NHibernate after an update?

Here is the scenario:
I have a winforms application using NHibernate. When launched, I populate a DataGridView with the results of a NHibernate query. This part works fine. If I update a record in that list and flush the session, the update takes in the database. Upon closing the form after the update, I call a method to retrieve a list of objects to populate the DataGridView again to pick up the change and also get any other changes that may have occurred by somebody else. The problem is that the record that got updated, NHibernate doesn't reflect the change in the list it gives me. When I insert or delete a record, everything works fine. It is just when I update, that I get this behavior. I narrowed it down to NHibernate with their caching mechanism. I cannot figure out a way to make NHibernate retrieve from the database instead of using the cache after an update occurs. I posted on the NHibernate forums, but the suggestions they gave me didn't work. I stated this and nobody replied back. I am not going to state what I have tried in case I didn't do it right. If you answer with something that I tried exactly, I will state it in the comments of your answer.
This is the code that I use to retrieve the list:
public IList<WorkOrder> FindBy(string fromDate, string toDate)
{
IQuery query = _currentSession.CreateQuery("from WorkOrder wo where wo.Date >= ? and wo.Date <= ?");
query.SetParameter(0, fromDate);
query.SetParameter(1, toDate);
return query.List<WorkOrder>();
}
The session is passed to the class when it is constructed. I can post my mapping file also, but I am not sure if there is anything wrong with it, since everything else works. Anybody seen this before? This is the first project that I have used NHibernate, thanks for the help.
After your update, Evict the object from the first level cache.
Session.Update(obj);
Session.Evict(obj);
You may want to commit and/or flush first.
what about refresh? - see 9.2. Loading an object of the docs:
"sess.Save(cat);
sess.Flush(); //force the SQL INSERT
sess.Refresh(cat); //re-read the state (after the trigger executes)
"

Resources