We are using vtiger cloud. To extract data from vtiger, we use Python >> WSClient library. The function is provided below.
def vtiger(admin, key, table, project_id):
ws = WSClient("https://URL.com")
dest = 'vtiger.{table_name}'.format(table_name=table)
if ws.do_login(admin, key):
response = ws.do_query(query='select count(*) from {table};'.format(table=table))
count = int(response[0]['count'])
array = []
for page in range(0, count, 100):
data = ws.do_query(query='select * from {table} limit {offset}, 100;'.format(offset=page, table=table))
for record in data:
array.append(record)
time.sleep(5)
df = pd.DataFrame.from_dict(array)
df.to_gbq(destination_table= dest, project_id = project_id, if_exists='replace' )
ws.logout()
We need to get only tickets created from createdtime >='2023-01-01'. When I try to modify
select * from {table} limit {offset}
with
select * from {table} where createdtime>='2023-07-01' limit {offset}
, I get the error
'WSClient.WebserviceException: VtigerWebserviceException(QUERY_SYNTAX_ERROR, Syntax Error on line 1: token '(' Unexpected PARENOPEN((), expected one of: EQ,LT,GT,LTE,GTE,NE,IN,LIKE,NOTLIKE)'.
What am I doing wrong?