# How to know if the field is used in a structure Field

**URL:** <https://forum.getkirby.com/t/how-to-know-if-the-field-is-used-in-a-structure-field/2935>\
**Category:** Questions\
**Tags:** v2\
**Created:** [December 31, 2015, 9:22am UTC](https://forum.getkirby.com/t/how-to-know-if-the-field-is-used-in-a-structure-field/2935 "2015-12-31T09:22:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![idris](https://avatars.discourse-cdn.com/v4/letter/i/13edae/32.png) [@idris](https://forum.getkirby.com/u/idris)\
**Post date:** [December 31, 2015, 9:22am UTC](https://forum.getkirby.com/t/how-to-know-if-the-field-is-used-in-a-structure-field/2935/1 "2015-12-31T09:22:13Z")

</div>

Hi,

I am trying to build a field named “Repeater” who can be used with the “Structure” field and normal blueprint. My plugin need to know when it uses in or out a structure field. But Var $parentFields apparently don’t return information correctly, it return only false.

I need to return a string in normal condition and an array in structure field condition.

Someone has a solution ?

If I can’t do the trick dynamically I am going to add a parameter to the field option.

I can share my field if you want but for now it is a try.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [December 31, 2015, 12:25pm UTC](https://forum.getkirby.com/t/how-to-know-if-the-field-is-used-in-a-structure-field/2935/2 "2015-12-31T12:25:58Z")

</div>

I dug through the Panel code and debugged it. This is actually a bug and the `$parentField` parameter is intended to contain the structure field but it doesn’t.

I [have opened an issue on GitHub](https://github.com/getkirby/panel/issues/715). Thanks for reporting!

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [March 8, 2016, 7:27pm UTC](https://forum.getkirby.com/t/how-to-know-if-the-field-is-used-in-a-structure-field/2935/3 "2016-03-08T19:27:26Z")

</div>

There is now a solution for this issue and a fix will be included in the next Kirby release. You can try it out by checking out the `develop` branch of the Panel.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:00pm UTC](https://forum.getkirby.com/t/how-to-know-if-the-field-is-used-in-a-structure-field/2935/4 "2025-02-06T17:00:01Z")

</div>


