Hello, I have a custom connector which is calling an Azure cognitive search API with facets. When I test it within the connector I get the correct response body. Here is the request I am passing in the connector. Here Facets is an array which I am passing.. the other parameters are simple texts.(string)
{"Search":"OIL",
"QueryType":"simple",
"count":true,
"facets: ["PrimaryBusinessSectorValue,count:1,"ReferredByValue,count:1"]
}
And this is the response.
I get two sets of results for both ReferredByValue and PrimaryBusinessSectorValue as shown above.
In the PowerApps , here is what I am passing.
ClearCollect(ColResponse, API.query("<api_key>",
{ Search : TextInput.text,
Count : "true"
Facets : Table({Value : PrimaryBusinessSectorValue,count:1},{Value :
ReferredByValue,count:1})
SearchType : "simple"
})
However I am not getting the response for both the facet values.. I get only the PrimaryBusinessSectorValue....
ideally in the collection I should see for both PrimaryBusinessSectorValue and ReferredByValue
@P_SA wrote:
....
Facets : Table({Value : PrimaryBusinessSectorValue,count:1},{Value :
PrimaryBusinessSectorValue,count:1})
....
You have {Value : PrimaryBusinessSectorValue,count:1} duplicated twice and ReferredByValue is not present.
If you correct it and make one of the records have Value:ReferredByValue, does it resolve your issue?
Sorry that was a typo. I have corrected the initial post. I am passing both the values from PowerApps
@P_SA For this part:
"facets: ["PrimaryBusinessSectorValue,count:1,"ReferredByValue,count:1"]
Could you clarify this part, there might be some typos here as well.
Please check on the Custom Connector schema and see what is defined for the request, if it is possible, to provide it as well, but at least to check on it.
Also please give an example of a valid request as if it were being issued directly.
I suspect this part might be of issue, (even if no longer considering the typo):
Facets : Table({Value : PrimaryBusinessSectorValue,count:1},{Value :
ReferredByValue,count:1})
I am not sure this is sending the request in the way that is expected.
If you could clarify this part, it might help.
This is the definition for the request.
this is the body of the request.
and this is the response body.
I managed to correct this by loading the response in the default response body of the connector
User | Count |
---|---|
262 | |
110 | |
98 | |
54 | |
39 |