cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Newbie2019
Level 8

Renaming a file and Creating a URI

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. 

 

4 REPLIES 4
Super User
Super User

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
Level 8

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

 

Super User
Super User

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
Level 8

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

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,020)