web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Renaming a file and Creating a URI

(0) ShareShare
ReportReport
Posted on by 238

I currently have 600 images in a OneDrive folder. All of the images have the same file format:

 

lastname, FirstName.jpg

 

I would like to change the files names to:

 

FirstName LastName

 

I would also like to create a URI for each. So, remove the comma and jpg and reverse the first and last and create a URI.

 

I would like to place this in a sharepoint folder or list called URIimages with:

 

Column1 = ImageName (First Last)

Column2= ImageURI

 

The image I will lookup in powerapps based on the name and then display the URI rather than a URL which i can only get to work on android, not IOS.

 

I would appreciate any suggestons on how this may be done. 

 

I have the same question (0)
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at
    Re: Renaming a file and Creating a URI

    @Newbie2019 wrote:

    I currently have 600 images in a OneDrive folder. All of the images have the same file format:

     

    lastname, FirstName.jpg

     

    I would like to change the files names to:

     

    FirstName LastName

     

    I would also like to create a URI for each. So, remove the comma and jpg and reverse the first and last and create a URI.

     

    I would like to place this in a sharepoint folder or list called URIimages with:

     

    Column1 = ImageName (First Last)

    Column2= ImageURI

     

    The image I will lookup in powerapps based on the name and then display the URI rather than a URL which i can only get to work on android, not IOS.

     

    I would appreciate any suggestons on how this may be done. 

     


    Tricky one, I think.  Good form. 🙂

    So, the way I used to do this was to dump a directory list into Excel, manipulate the filenames using a formula, and then adding the command prompt REN command for each line and saving all of the rows into a text (.bat) file.  Old school.  Represent.

    I think we can do this all in Flow, and the concept might be close to the same thing.  Are you using OneDrive? Or OneDrive for Business?

    I'm assuming this is a one-time thing?  The way I would do it would be to use the Manual trigger.  Then "List Files in a Folder", add those to a table in Excel, and then maybe run another Flow to do the Rename bit.  I'll noodle on this some, but does that sound like it will suit your scenario?  The code-friendly folks probably have a way to do this in 2 steps...that's not me. 🙂

    Let me know the specifics and we'll go from there.

    -Ed-

  • Newbie2019 Profile Picture
    238 on at
    Re: Renaming a file and Creating a URI

    Hi @edgonzales 

    I am using OneDrive for business. This is something that I'll need to do once per year, so yeah a mnual trigger would be the way to go. The pictures are ID photos for students at school. I've created an app in powerapps and want their picure to load to confirm their identity when issuing a detention for behaviour / uniform / mobile phone infringements. Smiley Very Happy

     

    I have then linked this to flow - outlook - to issue the detention with relevant details.

     

    The pictures has had me stumped. 

     

    So basically, I have:

     

    A OneDrive for business folder with the photos. 

    Each picture as I said has the file name   last, first.jpg

     

    The names in powerapps are in first last hence. As I'm doing a lookup, thats why I wanted to change them.

     

    Within sharepoint, I need a list with:

     

    1 column being the name

    1 column being the URI link

     

    Then I will do a lookup and pull back the image. URL doesn't work. Only URI.

     

    I found the following page on doing it, but don't understand it.

     

    https://www.bruce365.com/2018/10/11/display-sharepoint-images-on-mobile-devices-in-a-canvas-powerapp/

     

    I'm not sure of all the components of the flow.

     

    Any assistance that you could provide would be appreciated.

     

    Cheers.

    G

     

  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at
    Re: Renaming a file and Creating a URI

    Got it.  Two questions out of curiosity:

    1.  Will the filenames have the spaces indicated in your examples? Or was that to make it easier to read?

    2.  Are you renaming the files because the PowerApp is matching the images based on the student's name? Or have you set up an ID field, as well?  Just want to understand more of the process before we start getting into the meat of things.

     

    Thanks!

    -Ed-

  • Newbie2019 Profile Picture
    238 on at
    Re: Renaming a file and Creating a URI

    Hi @edgonzales 

    The space will remain in the name. The lookup from powerapps is based on the name. I have created a dummy run with the name in correct format and a few images as URI and it works well. I just dont want to have to manually do the all. It'll take days.

     

    I appreciate your help on this.

     

    G

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard