<p>I'm looking to set a 'score' property on my "category" field, this will be done by calculating how many entries are within that category similar to a 'Trending' feature.</p>

<p>Is there any way to set a property by doing a sum something like entry.count x 0.4 and then setting the field with the result?</p>

<p>Thanks</p>

CC BY-SA 3.0
2018-04-07T14:55:07.040Z
Since this value is always dynamic you could just `count` the elements each time you would like to display the number rather than save it into a field. Otherwise you would have to use the `onSave` event to store the information
Robin Schambach
CC BY-SA 3.0
2018-04-07T17:44:43.177Z
@RobinSchambach That’s a solid answer, you should post it. I actually think that’s the best solution.
Lindsey D
<categories><entry>
Setting an Entry field using sum
# Setting an Entry field using sum

(Asked by: username_0 on 2018-04-07)

I'm looking to set a 'score' property on my "category" field, this will be done by calculating how many entries are within that category similar to a 'Trending' feature.

Is there any way to set a property by doing a sum something like entry.count x 0.4 and then setting the field with the result?

Thanks

**Tags:** categories, entry

> **Comments:**
> **username_1**: Since this value is always dynamic you could just `count` the elements each time you would like to display the number rather than save it into a field. Otherwise you would have to use the `onSave` event to store the information  
> **username_2**: @RobinSchambach That’s a solid answer, you should post it. I actually think that’s the best solution.  

---

## 0 answers

