Exception: QueryXML contains more than 1 UDF Field

When doing an API query for multiple objects with more than one UDF field in the query builder, the execution result is below. This may be a limitation of Autotask, but I wanted to confirm.

An exception was encountered: Autotask returned an unexpected response to command [query]: {“queryResult”:{“ReturnCode”:-1,“EntityResults”:{},“EntityResultType”:“installedproduct”,“Errors”:{“ATWSError”:[{“Message”:“QueryXML contains more than 1 UDF Field.”}]},“EntityReturnInfoResults”:{}}}

Hi @DonHouk

You are correct that this error is returned directly from Autotask and is due to a limitation imposed in the Autotask API:

https://ww2.autotask.net/help/developerhelp/Content/APIs/SOAP/APICalls/QueryCall.htm?Highlight="You%20can%20only%20query%20by%20one%20user-defined%20field%20at%20a%20time"

Thanks, Travis. Do you know if this is also a limitation of the REST API? I saw you were looking to switch to that at some point.

Unfortunately, the same limitation exists in both versions of the Autotask API. Here are the docs for the REST API:

CleanShot 2024-10-22 at 13.56.54

That’s unfortunate. I wonder why. It might be a performance problem to query by more than one, but this is fairly limiting in getting the correct data out of AT assets that have many UDFs.

Thanks for confirming.

We may consider adding logic on our side that eases the process of performing multiple queries and then merging the results. Hmm… :thinking:

Yes! It would be helpful if we could get a dataset from Autotask and then manipulate the data further with more queries before iterating.