# Plantings Reports both planned and current

**URL:** <https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059>\
**Category:** Using farmOS\
**Created:** [January 17, 2022, 8:57am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059 "2022-01-17T08:57:12Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliverp44](https://avatars.discourse-cdn.com/v4/letter/o/d26b3c/32.png) [@oliverp44](https://farmos.discourse.group/u/oliverp44)\
**Post date:** [January 17, 2022, 8:57am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/1 "2022-01-17T08:57:12Z")

</div>

I am using v. 2 and would like to be able to create a report that shows what crops I have, in what locations and what sizes. Ideally I would want to be able to select which growing season as well.

I am not very experienced at php, but do use quite a bit of mysql on vb .net platform.

If there is not something within the current structure that can give this sort of report is there a template I can follow to create it ?

Thanks for your help

Oliver

---

<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:** [January 17, 2022, 11:01am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/2 "2022-01-17T11:01:07Z")

</div>

@oliverp44 If you are willing to write some Python you can probably build a custom report to include whatever you like by pulling data from the farmOS API.

We have a farmOS.py library for Python to help with this: [Introduction | farmOS](https://farmos.org/development/farmos-py/) - there are some basic examples on that page and this one: [Client methods for farmOS 2.x | farmOS](https://farmos.org/development/farmos-py/client_2x/)

We also have a farmOS.js library for performing similar API requests using JavaScript: [Introduction | farmOS](https://farmos.org/development/farmos-js)

> a report that shows what crops I have, in what locations and what sizes

This API endpoint will give you all your Plant assets: `/api/asset/plant`

The `location` field on each asset will summarize where it is currently located.

As for size, that will depend on how/where you are tracking that.

The nice thing about a Python script is it allows for quick experimentation. If you end up making something that’s generally useful, a next step might be to build a module that does the same thing directly in the farmOS UI (via PHP/JS).

---

<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:** [January 17, 2022, 11:04am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/3 "2022-01-17T11:04:58Z")

</div>

Worth noting (in case you or anyone else who finds this thread weren’t aware) that you can also get a lot of the same information directly in the farmOS UI already by going to Records \> Assets \> Plant (or directly to this path: `/assets/plant`). This page lists all Plant assets, along with their current location, and has options to filter by crop/variety, season, and more. You can also export the results to CSV.

---

<div class="post-metadata">

**Author:** ![oliverp44](https://avatars.discourse-cdn.com/v4/letter/o/d26b3c/32.png) [@oliverp44](https://farmos.discourse.group/u/oliverp44)\
**Post date:** [January 17, 2022, 11:05am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/4 "2022-01-17T11:05:17Z")

</div>

Thanks - I will try that.

I was interested how other people do this sort of thing as producing lists of current crops and planning seems a fairly fundamental requirement for farming. As the information is all within farmOS it seems a shame to run a tandem spreadsheet.

---

<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:** [January 17, 2022, 11:06am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/5 "2022-01-17T11:06:07Z")

</div>

> [@mstenta](#):
>
> You can also export the results to CSV.

(Although at the time of this writing, there’s a bug with the CSV exports not respecting filter choices… we’re working on that here: [Client Challenge](https://www.drupal.org/project/farm/issues/3224663))

---

<div class="post-metadata">

**Author:** ![oliverp44](https://avatars.discourse-cdn.com/v4/letter/o/d26b3c/32.png) [@oliverp44](https://farmos.discourse.group/u/oliverp44)\
**Post date:** [January 17, 2022, 11:06am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/6 "2022-01-17T11:06:22Z")

</div>

That sounds great - would it include the location size ?

---

<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:** [January 17, 2022, 11:07am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/7 "2022-01-17T11:07:54Z")

</div>

> [@oliverp44](#):
>
> location size

Do you mean the acres/hectares/ft2/m2 of the field they are planted in?

This is not currently included in the `/assets/plant` list, but I could see that being a useful feature to add!

---

<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:** [January 17, 2022, 11:08am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/8 "2022-01-17T11:08:34Z")

</div>

You can see this information by clicking through to the Plant asset record itself though… The map will display the area of the asset’s polygon.

---

<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:** [January 17, 2022, 11:18am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/9 "2022-01-17T11:18:04Z")

</div>

One thing this does _not_ currently cover is the location of future plantings. The “Location” column will only show current location.

However, this is essentially what the Crop Plan module in v1 provided:

 ![crop-plan](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/e060007144f3d942c8cd82c0dce4c82140bfbd3a.png)

I am eager to get that module ported to v2. All help is welcome! 🙂

---

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [January 17, 2022, 11:18am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/10 "2022-01-17T11:18:36Z")

</div>

> [@mstenta](#):
>
> Worth noting (in case you or anyone else who finds this thread weren’t aware) that you can also get a lot of the same information directly in the farmOS UI already by going to Records \> Assets \> Plant (or directly to this path: `/assets/plant` ). This page lists all Plant assets, along with their current location, and has options to filter by crop/variety, season, and more. You can also export the results to CSV.

I’ve been thinking about a favorite filter or quickfilter if you like..  
Very often it’s the same filter beeing used, so a quick way to slecte a saved filter would be nice

---

<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:** [January 17, 2022, 11:19am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/11 "2022-01-17T11:19:32Z")

</div>

> [@pat](#):
>
> Very often it’s the same filter beeing used, so a quick way to slecte a saved filter would be nice

That would be a nice feature! In the meantime, a quick tip/shortcut is to save your filtered results as a bookmark in your browser. The filter options are stored in the URL string, so that works!

---

<div class="post-metadata">

**Author:** ![oliverp44](https://avatars.discourse-cdn.com/v4/letter/o/d26b3c/32.png) [@oliverp44](https://farmos.discourse.group/u/oliverp44)\
**Post date:** [January 17, 2022, 11:20am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/12 "2022-01-17T11:20:14Z")

</div>

Where is there best place to post ideas to be included going forward ? the size of the fields in ha would be really useful for the planting asset page. Also to have the site version number next to ‘Powered by FarmOS’ would be useful when comparing what version you are on.

---

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [January 17, 2022, 11:24am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/13 "2022-01-17T11:24:05Z")

</div>

Would help if I could… But I beleve this is above kindergarden level… 😛  
I’m looking alot forward to this.

---

<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:** [January 17, 2022, 11:30am UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/14 "2022-01-17T11:30:00Z")

</div>

> Where is there best place to post ideas to be included going forward ?

This (the forum) is the best place for general discussions/ideas currently. If someone wants to take on the work to implement something specific, they can work on it in a branch and open a pull request to propose including it. Or they can build it in a separate module that others can download (this has the most freedom for experimentation because it doesn’t need to go through the farmOS core review process/considerations/testing).

> Also to have the site version number next to ‘Powered by FarmOS’ would be useful when comparing what version you are on.

Fun fact: we actually did have this in v1 for a short period of time. I ended up deciding to remove it because it felt a bit like a security risk (if someone knew you were running a very old version that had a known security issue they might be able to exploit it). However that’s a pretty low risk I think. And anyway, a bit moot in v2 because…

In v2 we actually DO make the version visible publicly in the `/api` endpoint in the `meta.farm` section of the JSON.

---

<div class="post-metadata">

**Author:** ![oliverp44](https://avatars.discourse-cdn.com/v4/letter/o/d26b3c/32.png) [@oliverp44](https://farmos.discourse.group/u/oliverp44)\
**Post date:** [January 17, 2022, 1:54pm UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/15 "2022-01-17T13:54:46Z")

</div>

That looks similar to what would after. I am guessing that each planting must be specific to one field / bed otherwise it will show up as too many locations.

My coding is not up to much at the moment but if there was something basic and specific……

---

<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:** [January 17, 2022, 2:13pm UTC](https://farmos.discourse.group/t/plantings-reports-both-planned-and-current/1059/16 "2022-01-17T14:13:40Z")

</div>

> I am guessing that each planting must be specific to one field / bed otherwise it will show up as too many locations.

Actually it handles multiple plants per location - this is a common requirement for interplantings, or splitting a bed up into multiple subsections with multiple crops. The module also had a toggle to organize the timeline “by area” or “by planting”. The screenshot above is “by planting”. Here is what “by area” looks like:

 ![Screenshot from 2022-01-17 09-13-05](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/e97fed84d31551c5e097460c495bb53bfcd09cf6.png)
