Forum Discussion
Rares1055
Aug 17, 2023Copper Contributor
Double Version History
Hello,
I'm using a Power App to create and update a file in Sharepoint.
Unfortunately, I need to use Version History, but it creates 2 version history (one for Create and one for Update file).
Can I somehow bypass the first version history (the one when is created)?
Thank you!
- Lalit MohanIron Contributor
Hi Rares1055
Yes, you can bypass the first version history when creating a file in SharePoint using Power Apps. Here are the steps:
- Open the Power App that you are using to create and update files.
- Go to the Customize ribbon and select Forms.
- Open the form that you are using to create files.
- In the Properties pane, scroll down to the Versioning section.
- Clear the checkbox next to Create a version when the item is created.
- Save and publish the form.
Now, when you create a new file using the Power App, it will not create a version history entry. Only updates to the file will be tracked in the version history.
Here is an alternative solution:
- Create a new variable called BypassVersionHistory and set it to true.
- In the OnSuccess event of the button that you use to create a new file, add the following code:
Set(BypassVersionHistory, false);
This will set the BypassVersionHistory variable to false before the file is created. This will prevent SharePoint from creating a version history entry for the new file.
I hope this helps! Let me know if you have any other questions.
- Rares1055Copper Contributor
Thank you for your response.
I don't know if I understood well, I'm using in Power App a button that runs a power automate flow. In that flow are the create and update file.
Is it still valid for this because I don't find those settings.