cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
P_SA
Helper V
Helper V

Pass an array as a parameter from PowerApps to Custom connector

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.

 

P_SA_0-1663910701385.png

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_1-1663911101943.png

 

5 REPLIES 5

@P_SA 

 


@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.

P_SA
Helper V
Helper V

This is the definition for the request.

P_SA_0-1663913766189.png

this is the body of the request.

P_SA_1-1663913790233.png

and this is the response body.

 

P_SA_2-1663913846343.png

 

P_SA
Helper V
Helper V

I managed to correct this by loading the response in the default response body of the connector

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,627)