Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
 View Only

Rename a file in a SharePoint document library

  • 1.  Rename a file in a SharePoint document library

    Posted Aug 18, 2022 06:59 AM
    Hello,
    I am trying to rename a file in a SharePoint document library.  The flow is when a file is added to a SharePoint team site or Teams site it is moved to another site/document library, this works without issue.  To rename the file I am using the split command to get the file name and extension.  File name 'Document 01.docx' is renamed to '[_Doumnet 01_]-2022-08-17.docx'.  I use this expression to get the file name: split(first(split(outputs('Move_file')?['body/Name'],'.')),'_')  and this expression to get the file extension: 
    last(split(variables('varFullFileExtName'),'.')).  How do I get rid of the [_ and _] at the beginning and end of the file name?

    Thank you in advance for all of your help.


    ------------------------------
    John Heck
    ------------------------------