Skip to content

Commit dc59b99

Browse files
authored
Merge pull request MicrosoftDocs#2285 from MicrosoftDocs/canvasapp-cognitive-issue264
Canvas app work item 1626059 issue 264 fix for cognitive services api
2 parents de3a764 + fc22346 commit dc59b99

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

powerapps-docs/maker/canvas-apps/cognitive-services-api.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ manager: kvivek
66
ms.service: powerapps
77
ms.topic: conceptual
88
ms.custom: canvas
9-
ms.reviewer:
10-
ms.date: 12/08/2017
9+
ms.reviewer: tapanm
10+
ms.date: 01/17/2020
1111
ms.author: lanced
1212
search.audienceType:
1313
- maker
@@ -124,9 +124,8 @@ With that background, let's add the formula for the **OnSelect** property of the
124124
```powerapps-dot
125125
If( chkLanguage.Value = true,
126126
ClearCollect( languageCollect,
127-
TextAnalytics.DetectLanguage(
127+
TextAnalytics.DetectLanguageV2(
128128
{
129-
numberOfLanguagesToDetect: 1,
130129
text: tiTextToAnalyze.Text
131130
}
132131
).detectedLanguages.name
@@ -135,7 +134,7 @@ If( chkLanguage.Value = true,
135134
136135
If( chkPhrases.Value = true,
137136
ClearCollect( phrasesCollect,
138-
TextAnalytics.KeyPhrases(
137+
TextAnalytics.KeyPhrasesV2(
139138
{
140139
language: "en",
141140
text: tiTextToAnalyze.Text
@@ -146,7 +145,7 @@ If( chkPhrases.Value = true,
146145
147146
If( chkSentiment.Value = true,
148147
ClearCollect( sentimentCollect,
149-
TextAnalytics.DetectSentiment(
148+
TextAnalytics.DetectSentimentV2(
150149
{
151150
language: "en",
152151
text: tiTextToAnalyze.Text
@@ -183,7 +182,7 @@ To display the results of the API calls, reference the appropriate collection in
183182

184183
The **First()** function returns the first (and in this case only) record in **languageCollect**, and the app displays the **name** (the only field) associated with that record.
185184

186-
2. Set the **Text** property of the sentiment label to: `"The sentiment score is " & Round(First(sentimentCollect.Value).Value, 3)\*100 & "% positive."`.
185+
2. Set the **Text** property of the sentiment label to: `"The sentiment score is " & Round(First(sentimentCollect.Value).Value, 3)*100 & "% positive."`.
187186

188187
This formula also uses the **First()** function, gets the **Value** (0-1) from the first and only record, then formats it as a percentage.
189188

0 commit comments

Comments
 (0)