# Read only text filed within structure with random value

**URL:** https://forum.getkirby.com/t/read-only-text-filed-within-structure-with-random-value/25209
**Category:** Questions
**Tags:** v3
**Created:** [April 8, 2022, 8:19am UTC](https://forum.getkirby.com/t/read-only-text-filed-within-structure-with-random-value/25209 "2022-04-08T08:19:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![GDS](https://avatars.discourse-cdn.com/v4/letter/g/e0b2c6/32.png) [@GDS](https://forum.getkirby.com/u/GDS)
#### Post date: [April 8, 2022, 8:19am UTC](https://forum.getkirby.com/t/read-only-text-filed-within-structure-with-random-value/25209/1 "2022-04-08T08:19:31Z")

</div>

Hello,

How to pre-fill a text field in a structure with randomly generated value? Every time a user adds an item to a structure this field should be pre-filled with randomly generated value.

Can not find any hooks which would apply here.  
Can this be done with Kirby?

Thank you in advance

---

<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: [April 8, 2022, 4:33pm UTC](https://forum.getkirby.com/t/read-only-text-filed-within-structure-with-random-value/25209/2 "2022-04-08T16:33:13Z")

</div>

With a default value you can prefill a field. Unfortunately, however, the default attribute doesn’t support the blueprint query language.

I think your only option here is to create a custom field that accepts a dynamic default value.

Because there is no hook that listens to when a structure item is created.
