Forum Discussion

Rares1055's avatar
Rares1055
Copper Contributor
Aug 17, 2023

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 Mohan's avatar
    Lalit Mohan
    Iron Contributor

    Hi Rares1055 

    Yes, you can bypass the first version history when creating a file in SharePoint using Power Apps. Here are the steps:

    1. Open the Power App that you are using to create and update files.
    2. Go to the Customize ribbon and select Forms.
    3. Open the form that you are using to create files.
    4. In the Properties pane, scroll down to the Versioning section.
    5. Clear the checkbox next to Create a version when the item is created.
    6. 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:

    1. Create a new variable called BypassVersionHistory and set it to true.
    2. 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.

    • Rares1055's avatar
      Rares1055
      Copper Contributor

      Lalit Mohan 

       

      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.

       

       

Resources