# Setting default values in Animal Assetr

**URL:** <https://farmos.discourse.group/t/setting-default-values-in-animal-assetr/886>\
**Category:** Development\
**Created:** [August 10, 2021, 1:52pm UTC](https://farmos.discourse.group/t/setting-default-values-in-animal-assetr/886 "2021-08-10T13:52:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![grolma](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@grolma](https://farmos.discourse.group/u/grolma)\
**Post date:** [August 10, 2021, 1:52pm UTC](https://farmos.discourse.group/t/setting-default-values-in-animal-assetr/886/1 "2021-08-10T13:52:53Z")

</div>

Hi, just installed this on my pi and trying to get to grips with it

ive got one breed of Sheep ( Boreray) ,who all have ear tags  
How can i set a default value ( or remove the 'required ’ bit in each of the input fields ?  
Ive had a play with ~ line 248 in profiles/farm/modules/farm/farm\_livestock/farm\_livestock.module  
but that didn’t do anything

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [August 10, 2021, 3:16pm UTC](https://farmos.discourse.group/t/setting-default-values-in-animal-assetr/886/2 "2021-08-10T15:16:24Z")

</div>

If you have admin access, you can enable the Field UI module and change default values and required field settings via the Drupal admin UI. [https://www.drupal.org/docs/7/core/modules/field-ui](https://www.drupal.org/docs/7/core/modules/field-ui)

I’m tempted to caution against this though, unless you have a very good reason, and know how to maintain these overrides alongside updates to farmOS. Could you describe a bit more why you want to do this? What are you trying to accomplish from a workflow perspective? Maybe I can help by suggesting alternatives. 🙂

The “proper” way to do this would be to write a module that alters these things, without touching/hacking the core farmOS code. This is one of the golden rules of farmOS (and Drupal): “don’t hack core” - don’t modify the farmOS code itself, unless you are proposing an upstream change. Otherwise you are essentially managing a fork of the software, and any changes you make need to be recreated every time you upgrade to a new version. A module, on the other hand, can be managed as it’s own code repository that simply “hooks into” certain parts of the farmOS/Drupal code and makes alterations.

---

<div class="post-metadata">

**Author:** ![grolma](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@grolma](https://farmos.discourse.group/u/grolma)\
**Post date:** [August 10, 2021, 3:29pm UTC](https://farmos.discourse.group/t/setting-default-values-in-animal-assetr/886/3 "2021-08-10T15:29:48Z")

</div>

to make it more straightforward entering 84 details of 84 sheep , to get started

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [August 10, 2021, 3:55pm UTC](https://farmos.discourse.group/t/setting-default-values-in-animal-assetr/886/4 "2021-08-10T15:55:35Z")

</div>

Maybe the CSV importer would help? [Import - farmOS.org](https://farmos.org/guide/import/)

---

<div class="post-metadata">

**Author:** ![grolma](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@grolma](https://farmos.discourse.group/u/grolma)\
**Post date:** [August 10, 2021, 4:16pm UTC](https://farmos.discourse.group/t/setting-default-values-in-animal-assetr/886/5 "2021-08-10T16:16:15Z")

</div>

had a look at that - no indication what defaults it may/may not accept or error checking with the input so i imagined having several goes at getting all the fields correctly formatted for it to accept anything  
And then there is still adding new stock as we get it

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [August 10, 2021, 5:34pm UTC](https://farmos.discourse.group/t/setting-default-values-in-animal-assetr/886/6 "2021-08-10T17:34:26Z")

</div>

If you are interested in coding, you might want to consider making a “quick form” in a custom module for your specific data entry needs. Then you can control exactly what information you are collecting, and exactly where it’s going.

There are a few examples in farmOS you can look at. I would recommend enabling the “Farm Quick” module first, and clicking the “Quick” tab on the dashboard to get a sense for what it might look like. Then you can use the existing quick forms as examples to work on developing your own.
