# Generate Random Mobile Number Starting With 07

**URL:** <https://community.postman.com/t/generate-random-mobile-number-starting-with-07/43140>\
**Category:** Help Hub\
**Tags:** tests, variables, scripts\
**Created:** [January 23, 2023, 12:49pm UTC](https://community.postman.com/t/generate-random-mobile-number-starting-with-07/43140 "2023-01-23T12:49:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ManishaDhiman](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@ManishaDhiman](https://community.postman.com/u/ManishaDhiman)\
**Post date:** [January 23, 2023, 12:49pm UTC](https://community.postman.com/t/generate-random-mobile-number-starting-with-07/43140/1 "2023-01-23T12:49:09Z")

</div>

Hi,

I am new to Postman and I want to generate random mobile numbers starting with 7 and prefix ‘0’. Can someone help me with this?

I am trying to test some registration thing again and again and for that every time i need to use new mobile number.

Thanks for the help !!!

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 23, 2023, 2:09pm UTC](https://community.postman.com/t/generate-random-mobile-number-starting-with-07/43140/2 "2023-01-23T14:09:56Z")

</div>

The following seems to work.

```auto
for (let i = 0; i < 10; i++) {

    let randomMobile = "07" + Math.random().toString().slice(2,11);
    console.log(randomMobile);

}

```

Taken from…

[JavaScript, Generate a Random Number that is 9 numbers in length - Stack Overflow](https://stackoverflow.com/questions/3437133/javascript-generate-a-random-number-that-is-9-numbers-in-length)

![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/8/98be4f470df7a8fd3c50360c3689c9b6de8a613b.png)

---

<div class="post-metadata">

**Author:** ![ManishaDhiman](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@ManishaDhiman](https://community.postman.com/u/ManishaDhiman)\
**Post date:** [January 24, 2023, 8:41am UTC](https://community.postman.com/t/generate-random-mobile-number-starting-with-07/43140/3 "2023-01-24T08:41:15Z")

</div>

Thanks @ mdjones, I will try this out !!!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [September 25, 2023, 3:18pm UTC](https://community.postman.com/t/generate-random-mobile-number-starting-with-07/43140/5 "2023-09-25T15:18:20Z")

</div>

Closed on September 25, 2023, 3:18pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
