Happy Business Starts Here

Invalid fields with AQuA

Newly Enrolled

Invalid fields with AQuA



I'm trying to write an integration which will query all the fields for an object using the AQuA API.

I am getting a list of all the fields using the describe endpoint, from them I'm creating the "select {fields} from {table}" query and send it to the endpoint.

To my surprise, I am getting errors for some of the objects, for example for the InvoiceItem I have no problem but for the Invoice object I'm getting the following error: 'There is a syntax error in one of the queries in the AQuA input"


I tried to investigate a little bit about the field that is causing the problem and found out that one of them is: BillRunId, but I don't understand why is there a problem with it (i do get it from the describe endpoint) or how to fix it and pull the data.


Is there any solution to get all the fields?

Thanks in advance.


Here is the full report (python)


{u'batches': [{u'apiVersion': u'89.0',
   u'batchType': u'zoql',
   u'full': True,
   u'localizedStatus': u'pending',
   u'name': u'invoice',
   u'query': u'select AccountId, AdjustmentAmount, Amount, AmountWithoutTax, AutoPay, Balance, BillRunId, BillToContactSnapshotId, Body, Comments, CreatedById, CreatedDate, CreditBalanceAdjustmentAmount, DueDate, Id, IncludesOneTime, IncludesRecurring, IncludesUsage, InvoiceDate, InvoiceNumber, LastEmailSentDate, PaymentAmount, PostedBy, PostedDate, RefundAmount, RegenerateInvoicePDF, SoldToContactSnapshotId, Source, SourceId, Status, TargetDate, TaxAmount, TaxExemptAmount, TransferredToAccounting, UpdatedById, UpdatedDate from invoice',
   u'recordCount': 0,
   u'status': u'pending'}],
 u'encrypted': u'none',
 u'errorCode': u'90005',
 u'format': u'CSV',
 u'message': u'There is a syntax error in one of the queries in the AQuA input',
 u'name': u'invoice_2018-03-01T14:16:31.515038+00:00',
 u'status': u'error',
 u'useLastCompletedJobQueries': False,
 u'version': u'1.0'}



Zuora Staff

Re: Invalid fields with AQuA

While there's a lot of overlap between the field names returned by the describe and the relevant data source they are NOT actually guaranteed (or documented) to be the same. The describe gives you the underlying data object attributes and so the field names will match if you are using an API query call, but the data sources include some useful data transformations and (much less useful) name changes. In your example you probably need 'Id' instead of BillRunId (but caution I haven't actually tried your specific call, I'm just relating past experiences). The easiest way I know of to know which fields you can use is to look at them in the Data Source UI.