I'm using dynamic values function in the TX REST connector 9.1.0.0. I use id's from another endpoint to loop through in my second endpoint path. This works well when I use “From Endpoint Table” but now I want to add a filter to only get the id's with a flag “hasresponse=true”.
I've read the page
but I still get an error with my Endpoint query. “No such table” the error message says.
I've tried several things like adding a schema. But all with the same response. Is there something wrong with my syntax?
Error:
Best answer by Thomas Lind
We have resolved the issue. When you get an error like the one above while using a endpoint query,
Failed to execute endpoint 'Trigion_01_ResponsesTest': SQL logic error no such table: Trigion_01_RespondentList code = Error (1), message = System.Data.SQLite.SQLiteException (0x87AF001F): SQL logic error no such table: Trigion_01_RespondentList at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, SQLiteCommand command, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain) at System.Data.SQLite.SQLiteCommand.BuildNextCommand() at System.Data.SQLite.SQLiteDataReader.NextResult() at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave) at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior) at TimeXtender.RestEngine.SqliteInstance.ExecuteQuery(String query) at TimeXtender.RestEngine.RestEngine.GetDynamicValuesDictionaries(ExecutionConfigurationContainer configContainer) at TimeXtender.RestEngine.RestEngine.ExecuteDynamicValuesLoop(ExecutionConfigurationContainer configContainer) at TimeXtender.RestEngine.RestEngine.ExecuteEndpoint(ExecutionConfigurationContainer configContainer) at TimeXtender.RestEngine.RestEngine.<>c__DisplayClass30_0.<CreateExecutionTask>b__0()
you will also get another error for the other endpoint like this.
So due to two fields in the endpoint having the same name it did not work.
Once we added a conversion so one company field were called company2 and made sure to only use table flattening for the endpoint the error went away.
It is important that you run the import metadata to see that it works as you could get a similar error by testing the connection.
Yes I use table flattening. The (flattened) table in which I retrieve the id's is called Trigion_01_RespondentList. I could select them from the dropdown menu. Also if I use a shorter name for the respondentlist table, without underscores, I get the same error.
Hi @JogchumSiR , this works for me as well. This was my base version. In my improved version I'd like to filter upfront the userlist. For your example it could be all AD users from the Sales department. Just for example. That is why I'm trying to use the query function.
In my case the userlist is a list of all recipients we did sent an survey to. This same list has a boolean flag which shows which users responded. In my second API call I need to loop through all recipient id's which have responded to the survey.
@Thomas Lind this wouldn't work for me. The “responses” endpoint call seems correct, I only wish to filter the id's from endpoint 1 “respondentlist” upfront before making the “responses” endpoint call.
Hi! Just wanted to add to this discussion. Does this work with pagination on the dynamic endpoint and if so, how are you supposed to set that up?
I have the “header” endpoint set up like this, with table flattening and all that, but I also have to use pagination to not drag the whole API down when reading data from it:
Then I use this endpoint in an Endpoint query like this:
Technically this works but when I synchronized the Metadata I noticed that then number of cache files that had been created was suspiciously even. The data from the first endpoint contains about 39k Id:s but only 5000 had been fetched for the dynamic query.
This number equals the number of results only from the first page from the Lifecare_hsl_orders endpoint as can be seen in the “limit” parameter in the topmost picture (you don’t see the pagination settings in that picture, but those are on the connector level). I thought that all the data from the “source” endpoint would be read first before it started to get processed on the second endpoint, but maybe that is not the case. How do I solve this?
I directly added a new endpoint without table flattening. Result is the same: no such table error (see below).
I've added a screenshot of my endpoint settings as png.
Failed to execute endpoint 'Trigion_01_ResponsesTest': SQL logic error no such table: Trigion_01_RespondentList code = Error (1), message = System.Data.SQLite.SQLiteException (0x87AF001F): SQL logic error no such table: Trigion_01_RespondentList at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, SQLiteCommand command, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain) at System.Data.SQLite.SQLiteCommand.BuildNextCommand() at System.Data.SQLite.SQLiteDataReader.NextResult() at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave) at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior) at TimeXtender.RestEngine.SqliteInstance.ExecuteQuery(String query) at TimeXtender.RestEngine.RestEngine.GetDynamicValuesDictionaries(ExecutionConfigurationContainer configContainer) at TimeXtender.RestEngine.RestEngine.ExecuteDynamicValuesLoop(ExecutionConfigurationContainer configContainer) at TimeXtender.RestEngine.RestEngine.ExecuteEndpoint(ExecutionConfigurationContainer configContainer) at TimeXtender.RestEngine.RestEngine.<>c__DisplayClass30_0.<CreateExecutionTask>b__0()
We have resolved the issue. When you get an error like the one above while using a endpoint query,
Failed to execute endpoint 'Trigion_01_ResponsesTest': SQL logic error no such table: Trigion_01_RespondentList code = Error (1), message = System.Data.SQLite.SQLiteException (0x87AF001F): SQL logic error no such table: Trigion_01_RespondentList at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, SQLiteCommand command, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain) at System.Data.SQLite.SQLiteCommand.BuildNextCommand() at System.Data.SQLite.SQLiteDataReader.NextResult() at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave) at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior) at TimeXtender.RestEngine.SqliteInstance.ExecuteQuery(String query) at TimeXtender.RestEngine.RestEngine.GetDynamicValuesDictionaries(ExecutionConfigurationContainer configContainer) at TimeXtender.RestEngine.RestEngine.ExecuteDynamicValuesLoop(ExecutionConfigurationContainer configContainer) at TimeXtender.RestEngine.RestEngine.ExecuteEndpoint(ExecutionConfigurationContainer configContainer) at TimeXtender.RestEngine.RestEngine.<>c__DisplayClass30_0.<CreateExecutionTask>b__0()
you will also get another error for the other endpoint like this.
So due to two fields in the endpoint having the same name it did not work.
Once we added a conversion so one company field were called company2 and made sure to only use table flattening for the endpoint the error went away.
It is important that you run the import metadata to see that it works as you could get a similar error by testing the connection.
Good to mention, currently you will still get an error in the portal when you try the “test connection” for your endpoint using Endpoint query. In TDI the import metadata could be successful though. So you should ignore the error you get in the portal and try if import metadata works.
We have the same error that the table cannot be found. However, we do not get the second error for the other endpoint. Could there be another reason for this error?
Sorry, the problem has been resolved. We had forgotten to add the source endpoints first.
We overlooked this button. As a suggestion for improvement, maybe the selection of the first source endpoint could appear directly when you select “Endpoint query.”