How do I set up output variables for IBM Watson Tone Analyzer

TA

Hey there guys, I’m trying to use Tone Analyzer, Ive read UiPath’s documentation but I don’t know how to them up. Could someone please help with this. Thanks in advance!

1 Like

Hi @Russygrl,

You can create a Tone variable by typing ctrl+K and set your variable name e.g ibmToneVar. Then you could access the attribute by ibmToneVar.ToneName or ibmToneVar.Confidence. Same goes to Sentence Tones.

Let me know if this works.

Cheers,
Qui

@quihan thanks for your reply. I tried what you said and this is what I get. Documentation says that SentenceTone has to be an array but an array of what? Thanks for your help!

Hi @Russygrl,

Do you mind sending the output panel of your “Analyze General Tone” activity? It looks like there is something wrong with your output definition. It should be something like this:
Capture

Cheers,
Qui

sure here it isAnalyzingToneTest.xaml (3.9 KB)

Test98.xaml (5.2 KB)

I have problem opening the XAML file, most probably because of my version. Hope you can open the attached XAML file.

Cheers,
Qui

@quihan what should I put as the value in the assignment activity? Thank you for your help and sorry for the back and forth!

hi @Russygrl, have we solved the problem yet?

Cheers,
Qui

Hi there @quihan no, this is still unresolved. It’s a cold case :disappointed_relieved:

What problem are we having?

Cheers,
Qui

Hey there @quihan, when i assign a literal string to a variable and pass that variable to Watson, it works perfectly. But when I pass it variable(string) that has the text from a text file Watson is not able to read it. If you have time please take a look at the my replies I have provided screenshots. Thanks!

Hi @Russygrl, the screenshots are on outputs and nothing on inputs. Where are you having that problem?

Cheers,
Qui

@quihan please take a look at the Assign activity, that has a literal string and when I pass it to Watson, it works perfectly. but when I use the read text activity save it to a string variable and try to pass it, it fails

Hi @Russygrl, which read text activity are you using? When you say it fails, is the error from UiPath Studio or the AnalyzeGeneralTone activity?

Cheers,
Qui

Sure @quihan, let me show you. I have a text file with just some dummy text. Then I use the Read Text Activity and store it in variable called strMailStatus, then I pass that to Watson. When I run it I get the error in the second screenshot. The first screenshot is just the file with dummy text. Appreciate your help!!! Forum3PNG|690x156 Forum4

Hi @Russygrl, I’m not sure how you created your txt file but mine is working fine. Maybe try recreating your txt file or use notepad++ or some code editor to see whether there is a hidden carriage return character in your txt file.

Cheers,
Qui

oh wow really? well i just used notepad. but i will try using an ide.

That’s weird. Notepad should be fine. Do you want to try it with my text file?
test.txt (74 Bytes)
Cheers,
Qui

oh kool!! Thank you @quihan

hey good morning @quihan yea your text file worked. and afterwards I just deleted everything in the text file, since you suggested there may be hidden return, that I was using and added some text and it worked! thank you for your help!!!

1 Like