As we all know using Power Apps in combinations with Power Automate to run flows is a real winner. You can call a Flow to do all the complicated stuff while you keep your code in Power Apps simple and easy to understand.
Yesterday however I came across a bit of strange behaviour.
I started by create version 1 of my Flow
Then I run my flow from a button
Then I rename my flow to V2 Flow
Even though I renamed the flow my flow will still run when I click the button. This is probably quite good as you might not want all your apps to break
To clean things up I then readd my flow and now the code will show V2Flow.Run() instead of V1Flow.Run(). Ok So far so good.
When I look at the connections everything seems to be fine:
Now I’m exporting my app
And I’m importing my app again
But as a I rename my flow the connection is showing up a bit weirdly. There seems to be a Display name and a run name for a flow.
This is different behaviour for if you have imported the Powerapp or if you have just created a Powerapp.
So what does this mean?
Now that I’ve updated my Flow name the code looks like it is still running v2 of my flow where actually v3 is called. This will make the code potentially confusing. You can of course update all occurrences of the flows but this is quite a painful process if you end up with larger apps having many flows started from the app.
So what should we do?
Try to avoid changing flow names is the better approach. Try to avoid flow names that have version numbers. And the same of course for names that are different between environments. I often see flows being names something like MyFlow_DEV_v21. Just call it MyFlow and keep track of your versions in a different way.