You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/maker/canvas-apps/cognitive-services-api.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ manager: kvivek
6
6
ms.service: powerapps
7
7
ms.topic: conceptual
8
8
ms.custom: canvas
9
-
ms.reviewer:
10
-
ms.date: 12/08/2017
9
+
ms.reviewer: tapanm
10
+
ms.date: 01/17/2020
11
11
ms.author: lanced
12
12
search.audienceType:
13
13
- maker
@@ -124,9 +124,8 @@ With that background, let's add the formula for the **OnSelect** property of the
124
124
```powerapps-dot
125
125
If( chkLanguage.Value = true,
126
126
ClearCollect( languageCollect,
127
-
TextAnalytics.DetectLanguage(
127
+
TextAnalytics.DetectLanguageV2(
128
128
{
129
-
numberOfLanguagesToDetect: 1,
130
129
text: tiTextToAnalyze.Text
131
130
}
132
131
).detectedLanguages.name
@@ -135,7 +134,7 @@ If( chkLanguage.Value = true,
135
134
136
135
If( chkPhrases.Value = true,
137
136
ClearCollect( phrasesCollect,
138
-
TextAnalytics.KeyPhrases(
137
+
TextAnalytics.KeyPhrasesV2(
139
138
{
140
139
language: "en",
141
140
text: tiTextToAnalyze.Text
@@ -146,7 +145,7 @@ If( chkPhrases.Value = true,
146
145
147
146
If( chkSentiment.Value = true,
148
147
ClearCollect( sentimentCollect,
149
-
TextAnalytics.DetectSentiment(
148
+
TextAnalytics.DetectSentimentV2(
150
149
{
151
150
language: "en",
152
151
text: tiTextToAnalyze.Text
@@ -183,7 +182,7 @@ To display the results of the API calls, reference the appropriate collection in
183
182
184
183
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.
185
184
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."`.
187
186
188
187
This formula also uses the **First()** function, gets the **Value** (0-1) from the first and only record, then formats it as a percentage.
0 commit comments