# Filter by uuid in pages field

**URL:** <https://forum.getkirby.com/t/filter-by-uuid-in-pages-field/27365>\
**Category:** Questions\
**Tags:** v3\
**Created:** [December 22, 2022, 5:09pm UTC](https://forum.getkirby.com/t/filter-by-uuid-in-pages-field/27365 "2022-12-22T17:09:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peppergreen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/peppergreen/32/12748_2.png) [@peppergreen](https://forum.getkirby.com/u/peppergreen)\
**Post date:** [December 22, 2022, 5:09pm UTC](https://forum.getkirby.com/t/filter-by-uuid-in-pages-field/27365/1 "2022-12-22T17:09:16Z")

</div>

Hey!

I have a question about the new uuid functionality, specifically about the filtering. I use a pages field like this:

```auto
category:
	label: Category
	type: pages
	query: kirby.collection("categories")
	link: false
	required: true
	translate: false

```

This works fine in the panel and in the frontend. This category field is stored like this in the txt-file btw:

```auto
Category: - page://rpB2zendwVFJIkCR

```

But if I append a filter like this, no page (children of ‘angebote’) will be found:

```auto
$categories = ['page://P52Rxoj5JFB3zmMI', 'page://rpB2zendwVFJIkCR'];
$results = page('angebote')->children()->listed()->filterBy('category', 'in', $categories);

```

What am I doing wrong? At least the page with the quoted content of the txt-file should be found.

Thanks! And a happy christmas and a happy new year to each and every one of you. 🎄

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [December 22, 2022, 6:21pm UTC](https://forum.getkirby.com/t/filter-by-uuid-in-pages-field/27365/2 "2022-12-22T18:21:18Z")

</div>

> [@peppergreen](#):
>
> `$results = page('angebote')->children()->listed()->filterBy('category', 'in', $categories);`

You have to either add a separator like this:

```auto
$results = page('angebote')->children()->listed()->filterBy('category', 'in', $categories, '-');

```

Or use a callback function where you first convert the field value to pages etc.

```auto

```

---

<div class="post-metadata">

**Author:** ![peppergreen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/peppergreen/32/12748_2.png) [@peppergreen](https://forum.getkirby.com/u/peppergreen)\
**Post date:** [December 22, 2022, 6:37pm UTC](https://forum.getkirby.com/t/filter-by-uuid-in-pages-field/27365/3 "2022-12-22T18:37:09Z")

</div>

Ahhh, its so simple! It works. Thank you really much for your quick reply.
