Hi,
I made a flow using this example:
https://youtu.be/MMIvU3OxyWE?si=bJRGYs9vJAfCsb5D
And It works fine, but in my case, the message to send has several lines, with blank lines as separator and when the process types the message in Whatsapp does not keep the space, it replaces the new line for an blank space.
This is the message in the Excel file, as you can see there are ALT+Enter between lines to separate them.
This is the message writing in Web Whatsapp:
As you see, the blank lines were ignored.
I can add {Enter} in the content of the column to force an enter command and it will split the message in several parts, but I want to send the complete content in only one piece, keeping the blank lines.
Is there a solution for this scenario? Can I add something in the Excel cell to fix that?
Thanks for any help!
I solved adding {Shift}{Enter} in the text message.
This is the way to add a new line in Web Whatsapp.
Thank you
@EmilioRoqueta69
I don't have an immediate solution for your reported issues, but I've come up with a workaround that addresses your problems. However, this workaround might affect performance as it's not optimized. Therefore, I recommend thoroughly testing the performance it before implementing it in any real-time projects.
Followed Steps:
Launch Excel and Open File Under Existing Process:
Read Data from Excel:
Launch Edge Browser and Attach to Specified URL:
[In my scenario, I have accessed my web-based WhatsApp, completed the validation process, and it's in a ready-to-use state. then I have attached this instance with my browser]
4. Loop Through Each Row in ExcelData:
Set Message and Phone Number:
Construct WhatsApp URL:
Navigate to WhatsApp Web Page:
Wait for Page Content to Load:
Press the Send Button:
5. End of Loop.
Excel:
Flow Details:
Output:
Code:
Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\deenu\\OneDrive\\Documents\\Booking Details.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
WebAutomation.LaunchEdge.AttachToEdgeByUrl TabUrl: $'''https://web.whatsapp.com/''' AttachTimeout: 5 BrowserInstance=> Browser
LOOP FOREACH CurrentItem IN ExcelData
SET Message TO CurrentItem[1]
SET PhoneNumber TO CurrentItem[0]
SET URL TO $'''https://web.whatsapp.com/send/?phone=%PhoneNumber%&text=%Message%'''
WebAutomation.GoToWebPage.GoToWebPage BrowserInstance: Browser Url: URL WaitForPageToLoadTimeout: 60
WAIT (WebAutomation.WaitForWebPageContent.WebPageToContainElement BrowserInstance: Browser Control: appmask['Web Page \'https://web.whatsapp.com/\'']['Span \'send\' 3'])
WebAutomation.PressButton.PressButton BrowserInstance: Browser Control: appmask['Web Page \'https://web.whatsapp.com/\'']['Span \'send\' 2'] WaitForPageToLoadTimeout: 60
END
Thanks,
Deenuji Loganathan
🤖Automation Evangelist
Deenuji - Follow me on LinkedIn
-------------------------------------------------------------------------------------------------------------
If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🌟
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,083
Most Valuable Professional