# Pivot table update doesn't work

**URL:** <https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684>\
**Category:** Help me!\
**Tags:** typescript, related-data, join-table\
**Created:** [December 9, 2022, 4:39pm UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684 "2022-12-09T16:39:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reza\_Erami](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/reza_erami/32/4730_2.png) [@Reza\_Erami](https://community.forestadmin.com/u/Reza_Erami)\
**Post date:** [December 9, 2022, 4:39pm UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684/1 "2022-12-09T16:39:54Z")

</div>

## Feature(s) impacted

- relation tables
- updated entity

## Observed behavior

i have a table called giveawayTasks which is a pivot table between giveaways, and tasks tables  
this table has giveaway\_id, and task\_id to connect the other ends, also it has another column which is called order, which allows you to change the order of tasks in a giveaway  
when I try to update the order field, it says that the operation was successful, but it doesn’t save it in the database, it also shows on the collection that it is stored, but with one refresh the changes will be gone.

update message:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/fa00afb1ca5863426066dbdfce377695206b8853.png)

update log:  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/optimized/2X/0/0b8e6a6cfba71bd41d93a36693cacd830b08fc8f_2_690x26.png)

after refresh:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/4/41665d35972d0377e53897407a22967592fe85ab.png)

## Expected behavior

update the value of the field

## Failure Logs

## Context

- Project name: Merit circle
- Team name: operations
- Environment name: all

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [December 12, 2022, 8:52am UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684/2 "2022-12-12T08:52:51Z")

</div>

Hi @Reza_Erami,

Could you please share the payload that is sent to your backend when saving 🙏 ?  
I will also need you agent type and version please (forest-express-sequelize@7.1.3, forest-rails@3.2.0, etc…)

---

<div class="post-metadata">

**Author:** ![Reza\_Erami](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/reza_erami/32/4730_2.png) [@Reza\_Erami](https://community.forestadmin.com/u/Reza_Erami)\
**Post date:** [December 12, 2022, 11:40am UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684/3 "2022-12-12T11:40:29Z")

</div>

this is what I get in browser network console  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/e/ef63040dc70224c03a9a93fb91e507fa00f3e4e0.png)

as you see in the attributes is empty, even I changed the value of the field

also on the server console it’s empty

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/5/529d81f50752e7c668fb36500fe83ce70aac7930.png)

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [December 12, 2022, 1:44pm UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684/4 "2022-12-12T13:44:58Z")

</div>

Is `Order` a simple number field ? It’s not a relationship right ?  
Could you share a video where you edit that field and show the payload sent 🙏 ? And also check if there is any error in your web console 🙏

---

<div class="post-metadata">

**Author:** ![Reza\_Erami](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/reza_erami/32/4730_2.png) [@Reza\_Erami](https://community.forestadmin.com/u/Reza_Erami)\
**Post date:** [December 12, 2022, 3:55pm UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684/5 "2022-12-12T15:55:51Z")

</div>

yep sure  
here it is

> **[Forest Admin ‣ Data ‣ Giveaways — Mozilla Firefox 2022-12-12 16-52-07.mp4](https://drive.google.com/file/d/1MdS3i2j5YcPgPK9GIy3UZ52CJLwgOuZ4/view?usp=share_link)**
>
> Google Drive file.

and just to let you know, it’s not read-only field

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/0/0917e677215e5cb1241184b3d091c0af4b6b545e.png)

---

<div class="post-metadata">

**Author:** ![Reza\_Erami](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/reza_erami/32/4730_2.png) [@Reza\_Erami](https://community.forestadmin.com/u/Reza_Erami)\
**Post date:** [December 13, 2022, 9:10am UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684/6 "2022-12-13T09:10:17Z")

</div>

another issue that i see is it’s not showing order field at all  
as you see in the database I have these values

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/9/97862e28276730525c583f3d72d176a5954b7d77.png)

but in forest admin it’s empty

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/b/bedcd46dad6bf670063aa2c65e06dc6dea4c79d6.png)

and the query on the console doesn’t contain order field

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/5/5ec2d50d79e5e1270708b3c20af65b4535150f5c.png)

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [December 13, 2022, 10:17am UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684/7 "2022-12-13T10:17:50Z")

</div>

Hi @Reza_Erami ,

I do not see the `order` in your schema, can you double-check ?  
If it is missing, you can redo the schema with `forest schema:update`. If it does not update correctly, try `forest schema:update -o tmp` which gonna create you a second folder with the schema recreated, you will be able to move the schema from giveawayTasks.

---

<div class="post-metadata">

**Author:** ![Reza\_Erami](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/reza_erami/32/4730_2.png) [@Reza\_Erami](https://community.forestadmin.com/u/Reza_Erami)\
**Post date:** [December 13, 2022, 11:44am UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684/8 "2022-12-13T11:44:03Z")

</div>

it’s already in the schema, otherwise, it wouldn’t show it on the collection  
besides, I regenerated this model multiple times, it didn’t help

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/2/286a219c8281076dd74ab4518683b89dbcffdb2a.png)

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [December 14, 2022, 11:25am UTC](https://community.forestadmin.com/t/pivot-table-update-doesnt-work/5684/9 "2022-12-14T11:25:24Z")

</div>

Hi,

1. Can you confirm me the exact project name ?  
I can see many Merit circle, with different terminology, in kebab-case, with an uppercase, without, etc.
2. Do you have a specific environment that has the problem and that I can take look at.
3. In some project, you have `giveaway_tasks` and `giveawayTasks`. Which one is the collection that you use and that have the problem ?
4. Can you send me the model file (in the folder `models`) of the specific collection ? You can send me privately if you don’t want to send it publicly.

Best regards,

Shohan
