# Dynamic field not updating when deleting entry in database?

**URL:** <https://forum.bubble.io/t/dynamic-field-not-updating-when-deleting-entry-in-database/22646>\
**Category:** Plugins\
**Created:** [January 8, 2018, 1:16am UTC](https://forum.bubble.io/t/dynamic-field-not-updating-when-deleting-entry-in-database/22646 "2018-01-08T01:16:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakubdab](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jakubdab/32/20111_2.png) [@jakubdab](https://forum.bubble.io/u/jakubdab)\
**Post date:** [January 8, 2018, 1:16am UTC](https://forum.bubble.io/t/dynamic-field-not-updating-when-deleting-entry-in-database/22646/1 "2018-01-08T01:16:45Z")

</div>

I’m learning how to write plugins.  
I want to display message with number to the user when he switches to another tab (i know, it may exist, but it’s for learning). So my plugin has 3 fields that user can fill:

- dynamic number - here goes Bubble expression, eg. (1) Search for items :count or (2) RepeatingGroup A’s list of items:count etc
- text on focus - easy
- text on blur - easy

**Example (1) Search for items :count**  
Now, all works almost fine: when user clicks another window or tab - “text on blur” is shown as page title, together with the dynamic number, eg. Messages: 4  
When I add rows in the database (still tab/window is not in focus, i do it from editor or another page) - the number changes - Messages: 5, etc  
But if now I delete item from database (through editor or another page) - text stays Messages: 5

**Example (2) RepeatingGroup A’s list of items:count**  
However, above is not the case if the Dynamic number uses the items from the RepeatingGroup on the same page. Or even if it stays with (1) as expression: Search for items:count AND there is a RepeatingGroup using same data on the page (through a separate Search). In these cases all works as expected: when items are added - Dynamic number increases, when deleted - decreases.

Question: why? how to make it go down in the example (1)? Should I somehow receive any “item was deleted” event in my plugin?

---

<div class="post-metadata">

**Author:** ![jakubdab](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jakubdab/32/20111_2.png) [@jakubdab](https://forum.bubble.io/u/jakubdab)\
**Post date:** [January 8, 2018, 11:50pm UTC](https://forum.bubble.io/t/dynamic-field-not-updating-when-deleting-entry-in-database/22646/2 "2018-01-08T23:50:30Z")

</div>

OK, since I found no answer so far - easier question, to @emmanuel, or whoever can answer:

is it a bug or a feature, that some elements (eg. Text or Input) as well as user designed plugins containing dynamic data (eg. Search for thing:count) don’t update on the page, when change “delete entry” is made to the database, but are updated when change is “new entry”?

Since you can’t play on my database - you can see what I mean by doing test here:

- open this page: [https://obiwan.bubbleapps.io/version-test?debug\_mode=true](https://obiwan.bubbleapps.io/version-test?debug_mode=true)

- open 2 (yes, two, not 2nd) tabs/windows with this page: [https://obiwan.bubbleapps.io/version-test/charts?debug\_mode=true](https://obiwan.bubbleapps.io/version-test/charts?debug_mode=true)

- on both pages (index and charts) there is bottom part containing Text and Input field with a number

- additionally, there is a test plugin changing title of the page when window focus is lost

- now go to one of the Charts pages and add new topping with some slices

- you should notice, that on other pages (index and 2nd chart page) Text and Input elements, as well as title, changed - they now contain old+1 value

- now on the same chart page delete added element by clicking the X in the repeatinggroup.

- on 2nd charts page all values are updated

- but on the index page old values are kept all over

- if you get back to one of charts pages and now add 1 or more new toppings - values will get updated everywhere, but once again - when you delete, only in one page they are lowered (hint: it works only, when RG is there)

I again ask the question from the beginning of this post:  
is it a bug or a feature of Text, Input, other elements? or I’m doing something wrong?
