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 / How to validate a What...
Power Automate
Unanswered

How to validate a WhatsApp number?

(0) ShareShare
ReportReport
Posted on by 565

Hi,

 

Using this example:

 

https://youtu.be/MMIvU3OxyWE?si=HikJddQvOF4DTxdg

 

I am reading an Excel file and send the messages thru Web WhatsApp.

But, when the phone number is wrong, I have no way to fix it.

This message appears, but I couldn't find a way to know and take any action.

 

EmilioRoqueta69_0-1719504207481.png

 

It would be useful to be able to know that this occurred to alert the user in some way.

Someone made something about it ?

 

Thanks for any help!

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @EmilioRoqueta69 

     

    Please ensure the WhatsApp URL works by entering it directly into the browser. If it functions correctly, then proceed to automate that URL.

     

    Note that the number mentioned in WhatsApp must already be saved in your contacts and associated with a WhatsApp account.

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    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 🚀

  • EmilioRoqueta69 Profile Picture
    565 on at

    Hi Deenuji,

     

    Inside the flow, I am opening https://wa.me/phonenumber, and I cannot get if this url fails, because the url opens and shows some message.

     

    Best Regards,

  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @EmilioRoqueta69 

     

    This is one of my old project in WhatsApp based automation. Please take a look and see it helps you.

     

    Follow the below 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_0-1719565194007.png

           

          appears 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_1-1719565195287.png

     

     

    Flow Details:

    Deenuji_2-1719565194971.png

     

    Output:

    Deenuji_3-1719565195297.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 🤖
    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 🚀

  • EmilioRoqueta69 Profile Picture
    565 on at

    Hi Deenuji ,

     

    Thank you for sharing!

    My flow is very similar, but I do not see when you manage the error for a possible wrong number.

     

    Thanks for you time!

  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @EmilioRoqueta69 

     

    I don't get your question. What you want to validate here?

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    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 🚀

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Deenuji 

     

    I think @EmilioRoqueta69  needs to handle this popup when validating whatsapp number as shared earlier- 

    Nived_Nambiar_0-1719600413669.png

     

    You have to use wait for web element action and check using condition whether webpage /element is loaded correctly or not

    Nived_Nambiar_1-1719600719368.png

     

    Hope this helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. 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