Black Lives Matter. Please consider donating to Black Girls Code today.

Two (or more) states for one callback

I am designing an app that takes in data from either 1 of 2 sources, in this case either data scraped online using pandas datareader or an uploaded file. How can I write the callback so that EITHER of these two buttons being picked triggers the entire callback?

As of this moment, I am getting around by manually using n_clicks, and lots of if statements, to prevent unnecessary bandwidth usage by the datareader, but the callback still runs each time I change anything since I don’t know how to set up two states.