# Filtering based off a getPhone

**URL:** <https://forum.wixstudio.com/t/filtering-based-off-a-getphone/18098>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [June 12, 2019, 10:00pm UTC](https://forum.wixstudio.com/t/filtering-based-off-a-getphone/18098 "2019-06-12T22:00:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![doughammack](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/doughammack/32/108659_2.png) [@doughammack](https://forum.wixstudio.com/u/doughammack)\
**Post date:** [June 12, 2019, 10:00pm UTC](https://forum.wixstudio.com/t/filtering-based-off-a-getphone/18098/1 "2019-06-12T22:00:48Z")

</div>

I am having a hard time with getting this code to work. I am trying to create a filter for a dataset which has field for phone number based off the logged in user’s phone number. Here is what I have so far:

import wixData from ‘wix-data’;  
import wixSite from ‘wix-site-backend’;

export function getPhone() {  
return wixSite.generalInfo.getPhone(phone);  
}

$w.onReady(function () {  
$w(“#StallSalesItem”).onReady(() =\> {  
$w(“#StallSalesItem”).setFilter(wixData.filter().eq(“trainerCellPhone”, phone)  
);  
}  
}  
Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [June 13, 2019, 4:24am UTC](https://forum.wixstudio.com/t/filtering-based-off-a-getphone/18098/2 "2019-06-13T04:24:12Z")

</div>

The [getPhone() function](https://www.wix.com/corvid/reference/wix-site-backend.generalInfo.html#getPhone) gets the site’s phone number - that is, your phone number, not that of the user. As stated in the documentation:

_The retrieved phone number is the phone number that has been entered in the_ _ **General Info** _ _section of your site’s Dashboard._

You can query the [PrivateMembersData Collection](https://support.wix.com/en/article/corvid-wix-members-privatemembersdata-collection-fields#phones-phones) to get the user’s phone numbers.

---

<div class="post-metadata">

**Author:** ![doughammack](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/doughammack/32/108659_2.png) [@doughammack](https://forum.wixstudio.com/u/doughammack)\
**Post date:** [June 13, 2019, 8:03pm UTC](https://forum.wixstudio.com/t/filtering-based-off-a-getphone/18098/3 "2019-06-13T20:03:07Z")

</div>

After looking at that page it looks like you can’t do that on a dynamic page, is that incorrect? Can I do query to get current logged in member phone? The dynamic page will only be available to logged in members.
