# Calculate in the Request update custom field

**URL:** https://community.awork.com/t/calculate-in-the-request-update-custom-field/2521
**Category:** Developer Forum
**Created:** [26. Dezember 2024 um 14:51 UTC](https://community.awork.com/t/calculate-in-the-request-update-custom-field/2521 "2024-12-26T14:51:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tim.guersch](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tim.guersch](https://community.awork.com/u/tim.guersch)
#### Post date: [26. Dezember 2024 um 14:51 UTC](https://community.awork.com/t/calculate-in-the-request-update-custom-field/2521/1 "2024-12-26T14:51:44Z")

</div>

Hi,  
i´m trying to set the value of a custom field on my tasks via api. I want to save the planned duration in a custom field. The problem is that the api returns only the duration in seconds. So when i try to put a request like this.  
POST [https://api.awork.com/api/v1/tasks/1039b67b-f946-4a36-a090-52d31f341545/setcustomfields](https://api.awork.com/api/v1/tasks/1039b67b-f946-4a36-a090-52d31f341545/setcustomfields)  
[ {  
„customFieldDefinitionId“: „dc4832f4-cc60-47e2-8c68-2825cd04aff0“,  
„numberValue“:„12000/3600“  
}]

I get an error:  
„List form“ from the request body as JSON.

Is there a way to calculate the duration in h in my request or do i need to calcualte ist before my request

Thanks for the help.

---

<div class="post-metadata">

### Author: ![Sebastian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.awork.com/sebastian/32/89_2.png) [@Sebastian](https://community.awork.com/u/Sebastian)
#### Post date: [29. Dezember 2024 um 12:11 UTC](https://community.awork.com/t/calculate-in-the-request-update-custom-field/2521/2 "2024-12-29T12:11:32Z")

</div>

Hi @tim.guersch, yes, you need to send the final value to the awork API, it won’t do the calculation for you.

---

<div class="post-metadata">

### Author: ![Sebastian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.awork.com/sebastian/32/89_2.png) [@Sebastian](https://community.awork.com/u/Sebastian)
#### Post date: [29. Dezember 2024 um 12:15 UTC](https://community.awork.com/t/calculate-in-the-request-update-custom-field/2521/3 "2024-12-29T12:15:56Z")

</div>

You can find an example for how to set custom fields here: [Custom Fields — awork API | Documentation](https://developers.awork.com/customfields)
