# Map IList\<PointerItem\> to List\<Variant\>

**URL:** <https://forum.litium.com/t/map-ilist-pointeritem-to-list-variant/952>\
**Category:** Questions\
**Created:** [June 27, 2019, 3:20pm UTC](https://forum.litium.com/t/map-ilist-pointeritem-to-list-variant/952 "2019-06-27T15:20:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![magnus.bolling](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/magnus.bolling/32/222_2.png) [@magnus.bolling](https://forum.litium.com/u/magnus.bolling)\
**Post date:** [June 27, 2019, 3:20pm UTC](https://forum.litium.com/t/map-ilist-pointeritem-to-list-variant/952/1 "2019-06-27T15:20:42Z")

</div>

Hi,

Is it possible to map an `IList<PointerItem>` property of entity type ProductsProduct to a `List<Variant>`?

I’ve tried this with no success:

```auto
var favoriteItems = person.Fields.GetValue<IList<PointerItem>>("FavoriteItems")?.Select(x => x.MapTo<Variant>()).ToList();

```

Litium version: 7.2

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [June 27, 2019, 4:14pm UTC](https://forum.litium.com/t/map-ilist-pointeritem-to-list-variant/952/2 "2019-06-27T16:14:40Z")

</div>

The pointer will return a base product, so you can map to `BaseProduct` with the `EntitySystemId`.

```auto
var favoriteItems = person.Fields.GetValue<IList<PointerItem>>("FavoriteItems").Select(x => x.EntitySystemId.MapTo<BaseProduct>()).ToList();

```

---

<div class="post-metadata">

**Author:** ![magnus.bolling](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/magnus.bolling/32/222_2.png) [@magnus.bolling](https://forum.litium.com/u/magnus.bolling)\
**Post date:** [June 28, 2019, 6:46am UTC](https://forum.litium.com/t/map-ilist-pointeritem-to-list-variant/952/3 "2019-06-28T06:46:07Z")

</div>

Thanks Nils. I didn’t notice that it was base products in the list. Any plans to add support for picking variants in future releases?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [July 26, 2019, 6:46am UTC](https://forum.litium.com/t/map-ilist-pointeritem-to-list-variant/952/4 "2019-07-26T06:46:15Z")

</div>

Closed on July 26, 2019, 6:46am UTC

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