Paste from clipboard with a specific variable

you could use the predefined action "Transform & Copy Selection With Java Script" with this script:

async (clipboardContentString) => {
   // remove whitespace and -
   let phoneNumber = clipboardContentString.replace(/[\s-]/g, '');

   // open whatsapp
   let script = `/usr/bin/open whatsapp://send?phone=${phoneNumber}`
   runShellScript({script: script});
 
   return phoneNumber;
}

This would copy the number and immediately open whatsapp. If you want to copy separately use the predefined action "Transform Clipboard Contents" instead (the script stays the same)