Hey All,
I have an odd issue with getting data back from Dataverse using the Web API. I can connect to the endpoint just fine and I get a 200/OK http status. But there is no data returned by the searchquery API.
Any thoughts?
Here's a little more background:
I have enabled search in my environment, added a few tables to be indexed via my PowerAutomate solution, then added columns to be indexed using the 'Quick Find' views of my custom tables as advised in this article Configure Dataverse search to improve search results and performance - Power Platform | Microsoft Learn.
I can successfully use the global search within my model-driven power app. I can also search using the 'Search rows (preview)' dataverse action in Power Automate. In both scenarios, I get search results. So it seems that I have a perfectly functioning search index. But why isn't the API returning any data?
Here is the request/response from an "Invoke Http Request with Entra ID" action in Power Automate:
Target URI: https://MYENV.crm.dynamics.com
API: /api/data/v9.2/searchquery
Request body: { "top": 10, "count": "true",
"search": "Same keyword I used in the other two scenarios here"
}
Response:
"body": {
"@odata.context": "https://MYENV.crm.dynamics.com/api/data/v9.2/$metadata#Microsoft.Dynamics.CRM.searchqueryResponse",
"response": "{\"Error\":null,\"Value\":[],\"Facets\":{},\"QueryContext\":null,\"Count\":0}"
}
Notes:
1-I have called the WhoAMI service and it returns Ok.
2-I've also confirmed that my entities/tables that I'm searching have the 'SyncToExternalSearchIndex' set to True by calling this API: api/data/v9.2/EntityDefinitions(LogicalName='MyCustomTableNameHere')?$select=CanEnableSyncToExternalSearchIndex,SyncToExternalSearchIndex
(based on this article: Search for Dataverse records (Microsoft Dataverse) - Power Apps | Microsoft Learn
I'm not sure what else I'm missing here. I appreciate the help.
Thanks in advance.