Hi there,
My guess would be your best option is to use Regex. If you're not familiar, look up some tutorials on the internet. It can be tricky to get into it and your head around it at first, perhaps, but once you get it, it's a fantastic tool.
As a concrete solution and example (and suggestion, considering that I might not have understood fully what you're looking for, or that you need actually a broader solution...)
Once you have fetched your SMS text into say a message variable, you could then have a Variable set block where you set the same or another variable to be =
FindAll(message, "\\d+") - this would find all numbers that are at least 1 cifer long. In the concrete case of the example you posted it should return an array with ["392","400","7767701"]
This is of course more than you really wanted. So a better solution would be (but here again, I'm not sure if every message is "the same" in this, or ...) to look just for numbers that are 7 cifers long (like 7767701):
FindAll(message, "\\d\{7}")
The "\\d" will search for digits (numbers) in your string. the {7} specifies that it must be exactly 7 long. This way the 392,400 will not be counted, since it is interrupted by the ",". It should return an array with just the one element (if I'm not mistaken). The result will be a string, not a number. So if you want it to be number (integer) instead of a string you should use
+FindAll(message, "\\d\{7}")[0]
You can also use
www.regex101.com to check if this works with different messages that you receive. In Automate you have to use the double \\ and also put a \ before the { - but on the regex101 website you don't! It would mark it as an error. And if you just copy and paste the regex code from there to AM it wouldn't work, you'll first have to add those extra backlashes. That's just how AM works.
In this link I've already filled it in, so you can see directly what I mean, it will highlight only the number you're looking for:
https://regex101.com/r/gK9mrj/1
I hope this helps, like I said, regex at first can be tricky, but it's a great tool! If any of this is not clear or not working as you want, and even after reading up some more on regex and experimenting, let us know and we'll see if we can get it to work!