cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
quincyt
Level: Powered On

BadRequest on TextAnalytics DetectLanguage - InvalidRequestQueryString

Hi all,

 

I'm working on a PowerApp in which I'm trying to implement TextAnalytics. To understand how TextAnalytics works, I first followed the blog from @mblythe at https://powerapps.microsoft.com/en-us/blog/custom-connectors-and-text-analytics-in-powerapps-part-on....

From that blog I got the Sentiment and KeyPhrases part working (so my Text Analytics service in Azure works), but the DetectLanguage part keeps returning the following error:

TextAnalytics_error.JPG

 

The code I'm using to trigger it is:

ClearCollect( colLanguage, 
    TextAnalytics.DetectLanguage(
        {
            numberOfLanguagesToDetect: 1, 
            text: txtTextToAnalyze.Text
        }
    ).detectedLanguages.name
)

Anybody ran into the same issue and knows how to solve it? According to PowerApps itself the code should be fine as well. Also I can't find other posts on the internet about this specific error message.

 

Thanks in advance for your effort and response! Cheers, Quincy.

1 ACCEPTED SOLUTION

Accepted Solutions
stefanjin311
Level: Powered On

Re: BadRequest on TextAnalytics DetectLanguage - InvalidRequestQueryString

Hello quincyt,

 

I just have deleted the part of numberofLanguagesToDetect:1 and then the laungage detection works. But I donnot know why.

 

Thanks.

 

View solution in original post

3 REPLIES 3
alopes21
Level: Powered On

Re: BadRequest on TextAnalytics DetectLanguage - InvalidRequestQueryString

Hi did you find a resolution to this? I've got the same issue

quincyt
Level: Powered On

Re: BadRequest on TextAnalytics DetectLanguage - InvalidRequestQueryString

Hi @alopes21,

 

I'm afraid not. In my case, it was for demo purposes only. For my demo, I just filled the Language info by hand (just to fool the attendees). It's definitely an issue in the TextAnalytics Connector in PowerApps, because the API itself from Azure works fine. If you must fix it for your purpose, you could use Flow to make a direct web service call to the API. Initiate the Flow from PowerApps and send the input text along with it. Then make a web service call to the TextAnalytics API in Azure and use a Respond action in Flow to get the result back in PowerApps in a collection. This is what I used to get almost all other Cognitive Services (the Face and Speech API's were the hardest, but I got it to work) to work in my demo PowerApp.

If you need extra help, let me know. Cheers, Quincy

stefanjin311
Level: Powered On

Re: BadRequest on TextAnalytics DetectLanguage - InvalidRequestQueryString

Hello quincyt,

 

I just have deleted the part of numberofLanguagesToDetect:1 and then the laungage detection works. But I donnot know why.

 

Thanks.

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 112 members 5,188 guests
Please welcome our newest community members: