Visible App Action Button

I’ve been trying to look through all your previous videos but I can’t find the shortcut that uses the action button on iPhone to trigger an action based on the visible app. And if visible app is none then it can trigger something else too. Can you help me out with that. Thanks so much.