web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Writing a message in W...
Power Automate
Unanswered

Writing a message in Web Whatsapp does not keep blank lines

(0) ShareShare
ReportReport
Posted on by 565

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.

ExcelCell.png

 

This is the message writing in Web Whatsapp:

 

Message.png

 

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 have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @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:

    1. Launch Excel and Open File Under Existing Process:

      • Open Excel and load the specified Excel file under an existing process.
      • Path: C:\\Users\\deenu\\OneDrive\\Documents\\Booking Details.xlsx
    2. Read Data from Excel:

      • Read all cells from the opened Excel file and mentioned the first row as a header.
      • Store the range of values in a variable named ExcelData.
    3. 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:

    • For each row in ExcelData, do the following steps:
      1. Set Message and Phone Number:

        • Set the message to the value in the first column (index 0) of the current row.
        • Set the phone number to the value in the second column (index 1) of the current row.
      2. Construct WhatsApp URL:

      3. Navigate to WhatsApp Web Page:

        • Navigate to the constructed URL using the Edge browser instance.
        • Set a timeout of 60 seconds for the page to load.
      4. Wait for Page Content to Load:

        • Wait until the specified element (Whatsapp send button) Deenuji_3-1710335675464.pngappears on the WhatsApp web page.
      5. Press the Send Button:

        • Click on the send button on the WhatsApp web page.
        • Set a timeout of 60 seconds for the page to load.

    5. End of Loop.

    Excel:

    Deenuji_2-1710335207736.png

     

    Flow Details:

    Deenuji_0-1710334830528.png

    Output:

    Deenuji_1-1710335003773.png

     

    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 🌟

     
     
  • Verified answer
    EmilioRoqueta69 Profile Picture
    565 on at

    I solved adding {Shift}{Enter} in the text message.

    This is the way to add a new line in Web Whatsapp.

     

    Thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard