Hi there, I've developed my first PowerApps and Power Automate app that creates a PDF document in SharePoint from a PowerApp input form. However on testing, I get an error message that the file already exists, which I expected. On trying to resolve this, I'm running into issues.
I have checked existing posts and watched YouTube videos on how to check to see if a file name already exist and if it does, alert the user but can't find anything that achieves this. I think I will need to do this before the create file 2 action but not sure what action/component to use. Thanks
Solved! Go to Solution.
It works better if you have your flow set up before you try to link it into your Power App. I agree, test for the filename before you attempt to create a file with the same name or the flow fails. Here's a screenshot with the basic flow functionality:
Three main steps:
You can have the flow send some sort of response back to the app using the "Respond to Power App or Flow" block. By doing this, your MyFlow.Run() statement will return a value you can use in a variable, label Text property, or some other purpose.
However, I use an easy way to avoid all of this - try attaching a timestamp or random number to your filenames. In this way, you can allow your app to perform the same operation and each file resulting from it will have a different filename. It generates extra files, but it's unlikely to fail the flow due to a duplicated filename.
You'll want to include a Condition block in your flow to handle at least two cases: finding a file with the name or not. It's the flow equivalent of an If-Then statement. If you want PowerApps to return a message to the app user, you will need to structure it to respond in a way you can use in your app.
Thanks.
Do you have an example? I understand what it is I need but not sure how/where to structure it. The create file action/component creates a file with an hexadecimal string as seen below:
so, I think the conditional action will need to come before this.
Can you elaborate on the point you made concerning the return message.
It works better if you have your flow set up before you try to link it into your Power App. I agree, test for the filename before you attempt to create a file with the same name or the flow fails. Here's a screenshot with the basic flow functionality:
Three main steps:
You can have the flow send some sort of response back to the app using the "Respond to Power App or Flow" block. By doing this, your MyFlow.Run() statement will return a value you can use in a variable, label Text property, or some other purpose.
However, I use an easy way to avoid all of this - try attaching a timestamp or random number to your filenames. In this way, you can allow your app to perform the same operation and each file resulting from it will have a different filename. It generates extra files, but it's unlikely to fail the flow due to a duplicated filename.
Thanks. I will give this a try.
User | Count |
---|---|
149 | |
94 | |
85 | |
78 | |
57 |
User | Count |
---|---|
193 | |
175 | |
104 | |
95 | |
91 |