# Callback fired several times with no trigger (dcc.Location)

**URL:** <https://community.plotly.com/t/callback-fired-several-times-with-no-trigger-dcc-location/74525>\
**Category:** Dash Python\
**Tags:** question\
**Created:** [April 18, 2023, 11:10am UTC](https://community.plotly.com/t/callback-fired-several-times-with-no-trigger-dcc-location/74525 "2023-04-18T11:10:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loic\_L](https://avatars.discourse-cdn.com/v4/letter/l/b5ac83/32.png) [@Loic\_L](https://community.plotly.com/u/Loic_L)\
**Post date:** [April 18, 2023, 11:10am UTC](https://community.plotly.com/t/callback-fired-several-times-with-no-trigger-dcc-location/74525/1 "2023-04-18T11:10:09Z")

</div>

Hi,

Bit of a weird one here: I use the `dcc.Location` div (with `refresh=False`) to use the URL to populate different fields in my app with default values (or values from the URL). It triggers when opening the page as expected, and when I track the context (as recommended by the doc [here](https://dash.plotly.com/advanced-callbacks)), I get the expected:

```auto
## URL callback 1 / triggered by: {'url_content.search': 'url_content'}
{
  "states": {},
  "triggered": [
    {
      "prop_id": "url_content.search",
      "value": ""
    }
  ],
  "inputs": {
    "url_content.search": ""
  }
}

```

But immediately after, the callback fires a second time with no triggers:

```auto
## URL callback 1 / triggered by: {}
{
  "states": {},
  "triggered": [],
  "inputs": {
    "url_content.search": ""
  }
}

```

And this happens again (fires and update output but no trigger) when I change some other dropdowns in the form.

This is a new issue when updating dash from 1.4.1 to 2.9.3 (it worked fine before).

So 2 questions:

- do you know why a callback would fire without trigger?
- do you know how to find out why it fired if the ctx values are all empty?

Sorry I haven’t been able to replicate it in a minimal example, but the full code can be found in these files ([here](https://github.com/GreenAlgorithms/green-algorithms-tool/blob/master/app.py) and [here](https://github.com/GreenAlgorithms/green-algorithms-tool/blob/master/html_layout.py) ) : `fillInFromURL` is the callback firing all the time, especially when the platform and location dropdowns are touched)

Any help much appreciated!

EDIT: a way to go around that is to add this at the start of the trigger-happy callback…but that’s not a very clean solution:

```auto
if ctx.triggered_id is None:
        raise PreventUpdate

```
