# Tips for allow\_duplicate: good and bad use cases

**URL:** <https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459>\
**Category:** Dash Python\
**Tags:** show-and-tell, tips-and-tricks\
**Created:** [March 25, 2025, 8:29pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459 "2025-03-25T20:29:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![spriteware](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/spriteware/32/29140_2.png) [@spriteware](https://community.plotly.com/u/spriteware)\
**Post date:** [March 25, 2025, 8:29pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/1 "2025-03-25T20:29:11Z")

</div>

Hello!

I always felt that `allow_duplicate` was an option to use with some caution. 🙂  
But didn’t know how to explain. Today I was inspired from a question on the forum to investigate this further.

In the article, I explore one bad consequence of using `allow_duplicates=True`, and how to mitigate it.

> **[The dark side of allow\_duplicate & making callbacks sequential |...](https://dash-resources.com/avoiding-desynchronized-state-in-dash-sequential-callbacks-patch-and-better-design-patterns/)**
>
> I was inspired by this question on the Plotly community forum to talk about sequential callbacks and, more broadly, callback design with or without allow\_duplicate. \[...\]

The article is about callback design, sequential callbacks and a relevant use case of `Patch()`.

I hope it will open the discussion to some callback design strategies.  
Let me know what you think about it!

— Fran

EDIT

Following the discussion below, I created a new article that is more a tutorial on how to use “allow\_duplicate”.  
Here it is:

> **[How to use allow\_duplicate (good and bad practices) | dash-resources.com](https://dash-resources.com/how-to-use-allow_duplicate-good-and-bad-practices/)**
>
> A few weeks ago, I was inspired to write an article about the allow\_duplicate options and the possible drawbacks of using it. In this new \[...\]

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [March 25, 2025, 10:47pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/2 "2025-03-25T22:47:53Z")

</div>

Hello @spriteware,

I believe that you’ve made a strawman argument by using something like this. It is more efficient to use the values as a state and a submit button. XD

The power of allow\_duplicates is allowing the same output to be targeted from different things in the app, things that wouldn’t be entered at the same time or even on the same screen. For example, sending notifications to a single div container from multiple pages or buttons.

Coming from front end, I prefer the granulated control of set\_props and allow\_duplicates because it gives more targeted control over the elements.

To elaborate, it was quite confusing and ridiculous to have an app that kept growing for inputs and trying to keep the notifications separate when they were all in one callback. Even using pattern-matching it was a beast.

---

<div class="post-metadata">

**Author:** ![spriteware](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/spriteware/32/29140_2.png) [@spriteware](https://community.plotly.com/u/spriteware)\
**Post date:** [March 25, 2025, 11:07pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/3 "2025-03-25T23:07:27Z")

</div>

The title is maybe exaggerated 😁

> [@jinnyzor](#):
>
> Coming from front end, I prefer the granulated control of set\_props and allow\_duplicates because it gives more targeted control over the elements.

I do agree with you. It’s a very good thing that `allow_duplicates` exist, for some cases.

However, I think the callback normal behavior (an output updated by only one callback) is a good idea to enforce a good & maintainable logic. Just like circular dependencies, were forbidden at first, and now possible in some ways.  
Or “suppress\_callback\_exceptions”, which is certainly useful but error-prone.

I think it’s something “to use with caution”. Especially for beginners.

Thanks for adding your input, I really appreciate 🙏

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [March 25, 2025, 11:14pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/4 "2025-03-25T23:14:19Z")

</div>

The article is labeled as experienced though. 😜

It was an interesting take, and I hope there is a sequel of the benefits of allow\_duplcate and how to avoid the pitfalls.

---

<div class="post-metadata">

**Author:** ![spriteware](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/spriteware/32/29140_2.png) [@spriteware](https://community.plotly.com/u/spriteware)\
**Post date:** [March 25, 2025, 11:20pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/5 "2025-03-25T23:20:15Z")

</div>

> [@jinnyzor](#):
>
> The article is labeled as experienced though. 😜

I created a blog for beginners and end up writing stuff beginners don’t care about 😂

Joke aside, maybe it could be interesting to write another one to clarify “_when to use and when not to use allow\_duplicate_”.

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [March 25, 2025, 11:23pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/6 "2025-03-25T23:23:42Z")

</div>

> [@spriteware](#):
>
> Joke aside, maybe it could be interesting to write another one to clarify “_when to use and when not to use allow\_duplicate_”.

Yes! This would be very helpful 💯

---

<div class="post-metadata">

**Author:** ![adamschroeder](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/adamschroeder/32/17280_2.png) [@adamschroeder](https://community.plotly.com/u/adamschroeder)\
**Post date:** [March 26, 2025, 1:43pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/7 "2025-03-26T13:43:11Z")

</div>

I second that. **When to use and when not to use allow\_duplicate** would be a good article.

---

<div class="post-metadata">

**Author:** ![nathandrezner](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/nathandrezner/32/23874_2.png) [@nathandrezner](https://community.plotly.com/u/nathandrezner)\
**Post date:** [March 26, 2025, 2:31pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/8 "2025-03-26T14:31:01Z")

</div>

For those in the thread, maybe there’s some opportunity here to refine our documentation on duplicate callback outputs ([Duplicate Callback Outputs | Dash for Python Documentation | Plotly](https://dash.plotly.com/duplicate-callback-outputs)). I’m happy to provide feedback to the team – we have a few examples of when/why to use duplicate callback outputs but could certainly change or improve them!

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [March 26, 2025, 3:37pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/9 "2025-03-26T15:37:17Z")

</div>

Actually, now that there are so many advanced callbacks, it would be great to have an overview section describing the purpose of the different callbacks and when to use them.

---

<div class="post-metadata">

**Author:** ![nathandrezner](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/nathandrezner/32/23874_2.png) [@nathandrezner](https://community.plotly.com/u/nathandrezner)\
**Post date:** [March 26, 2025, 4:17pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/10 "2025-03-26T16:17:33Z")

</div>

Maybe in fact “Advanced callbacks” is a bit of a misnomer and discourages use; many of these patterns are applicable even to “simple” apps. Definitely IA that could be improved.

---

<div class="post-metadata">

**Author:** ![spriteware](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/spriteware/32/29140_2.png) [@spriteware](https://community.plotly.com/u/spriteware)\
**Post date:** [April 16, 2025, 5:30pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/11 "2025-04-16T17:30:44Z")

</div>

Hi!

Following our discussion above, I created another blog post, more like a tutorial, to help understand when to use allow\_duplicate properly.

Here it is:

> **[How to use allow\_duplicate (good and bad practices) | dash-resources.com](https://dash-resources.com/how-to-use-allow_duplicate-good-and-bad-practices/)**
>
> A few weeks ago, I was inspired to write an article about the allow\_duplicate options and the possible drawbacks of using it. In this new \[...\]

@adamschroeder @AnnMarieW @jinnyzor looking forward your comment and opinion on this! 😄

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [April 17, 2025, 3:02pm UTC](https://community.plotly.com/t/tips-for-allow-duplicate-good-and-bad-use-cases/91459/12 "2025-04-17T15:02:13Z")

</div>

Nice, I think this is useful.

One example, I’d like to point out is sending notifications to the user in DMC. 🙂
