Hi, I am new to UiPath. I am currently working on automating a workflow for sending individual messages to different people on WhatsApp. However, I am encountering an issue with setting the ‘number’ as a variable within the ‘ReadCsvFile’ function. When I try to ‘Set Value (String)’ in the ‘Assign’ function, it shows a red exclamation mark. Is there anything I can do to resolve this problem?
HI,
Probably number variable is defined in only the following red arrow scope.
Can you try to change scope of number variable to wider in variable panel?
Hi @nien_shan_thai ,
you variable " walink" is String?
you can assign all of them to string value
if you have any item in that not string, you need convert to string.
regards,
Hi yes, my ‘walink’ is String. May I know how to assign ‘number’ to string? I have tried add a write line ‘number.ToString’ and change to ‘waweburl+countrycode+(number).tostring+“&text=”+body’ but still cannot work.
Hi, thanks for your guidance. I think the error is because of the ‘number’ instead of ‘body’ because the red exclamation mark shows after i add in ‘number’.
Hi @nien_shan_thai ,
I see your file, but have a problem
I don’t have a csv file or text file, but I guess it will have many lines, right? So why does getting the link only take 1 line, it won’t understand, so to assign to the other list row, you have to leave it’s in the for loop, right? Send msg via WhatsApp.xaml (21.1 KB)
you can see it
Hi @Nguyen_Van_Luong1 , for the csv file which fill in sender’s phone number, it just have one row. The text file is the body that wish to send to the person. Yes, i will need the loop. It appears this when i do the test run. Send message via WhatsApp - Copy.zip (129.2 KB)
Send message via WhatsApp.zip (9.3 KB)
You can see here,
It can set multiple row
if outside loop
it get only last item
I edited it, you can check, ask me if have any error
Furthermore, I noticed for the ‘body’ to send, it just will pick up the 1st word in the text file. Is it will be better if i include the body in word in the workflow?
Hi @nien_shan_thai ,
Is this link correct?
I think we dont need word, you can write to wor, text or excel… etc, because it will return String value
in here I think your logic with this process is not really good, we can use only screen with only link, send to multi people, we can use loop inside website, each loop, we send to a person. how are you think about that?