REST API call with select question
Hello!
I found a very helpful PHP SDK for Ninox at Github.
And I think my case / problem is quite easy.
The SDK gives you "queryRecords", where you can add a table and do a filter and/or query.
And there is a "evalQuery" function, where you can send directly a query.
Does not matter which one I use, I just try to get all records of a table where a certain field has a certain value. But I never get the expected result.
 
At the moment my query looks like:
(select Service where Dienstleistung = "Reinigung").Name
The result is always empty.
Since other calls work, e.g.:
$client->queryRecords($tableList['Fachbereich']->id, array('order' => 'Name'));
... I expect that it is not a connection issue.
 
In another example I read something about if you do a query, define the object that you want to get as a result.
$client->queryRecords(
    $tableList['Service']->id,
    array('query' => 'for i in select Service where Dienstleistung = 'Reinigung' do {"Name":i.Name} end')
);
But here I've almost the same problem, it ignores the "were"-condition and returns just everything.
11 Antworten
- 
  Das kommt mir bekannt vor... ist Dienstleistung ein Auswahlfeld? Dann nimm doch mal "like" statt "=" - oder wenn du "=" benutzen willst, dann nimm die Nummer der Option im Auswahlfeld statt des Textes "Reinigung" .... (select Service where Dienstleistung like "Reinigung").Name (select Service where Dienstleistung = 4).Name
- 
  dann versuche es mal mit first() first((select Service where Dienstleistung = "Reinigung")).Name
- 
  Versuch's mal mit chosen(): (select Service where chosen(Dienstleistung, "Reinigung")).Name
- 
  SoGenau said: 
 Wobei chosen auf jeden Fall notwendig war,Ja, mit chosen() fragt man bei Mehrfachauswahlfeldern ab, ob ein bestimmter Eintrag ausgewählt wurde. Bei einfachen Auswahlfeldern genügt ein "=". 
Content aside
- vor 2 JahrenZuletzt aktiv
- 11Antworten
- 197Ansichten
- 
    3
    Folge bereits
    
