cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
eXir
Frequent Visitor

Change filename of a saved camera image in Onedrive (excel)

I'm making an app based on the MS example: "Site Inspection".

 

This example app uses OneDrive and:
Creates a file data.xls

Creates a folder data_images

Creates multiple images (1-100.jpg, 1-101.jpg)

 

When i add a 2 new photos using the app it creates 2 new rows in excel and add the images in the data_images folder.

Excel:

image.png

 

 

 

 

 

 

 

 

 

 

 

 

 

As you can see the filename look like a GUID. I Want it to be 6-100 and 6-101 like the previous ones.

 

Is this possible to do? (looks like the example data is manual edited?)

 

This question has been asked before (see bottum of the page, but the original question is solved:
Link

 

A microsoft blog almost has an answere (the call an API with a function whre FileName is added)

Blog

 

Collect(MyPictures, {URL:ImageUploadAPI.UploadImage(Camera1.Photo, {fileName: TextInput1.Text}).FileURL, Name:TextInput1.Text, Time:Now()})

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi @eXir,

 

Currently I can't find a way to change the image name saved by the camera control within PowerApps, the image name should be saved automatically.

And yes, here I suggest to change the name manually, for both the Excel data and the Image in the image folder.

Besides, I think it is a good idea for the camera control to have a property to rename the image saved.

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-micsh-msft
Community Support
Community Support

Hi @eXir,

 

It should work.

in addition to the Excel data, you should notice that there is an image folder generated together, if you would like to modify the image name under the Excel table, then please make sure the image saved into the Image folder also changes to the corresponding name.

 

The path under the Excel table should be a relative path for PowerApps to find the image saved, if the value (or saying the image name ) matches, then PowerApps should work.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-micsh-msft

 

Thanks for the reply. 
The app is working fine, excel and the folder are updated every time. 


What i want is to modify the file name or give some extra information in the image file.

 

From the camera screen you can find both these OnSelect were the image is created with.

Photo :Camera1.Photo
Photo:Last(FirstN(CameraPhotos;1))

 

If(CountRows(CameraPhotos) <=7 ;Collect(CameraPhotos; {Note:"";Photo :Camera1.Photo; PhotoId :CountRows(CameraPhotos)}))
If(NewRecord;Navigate(NewInspectionScreen;ScreenTransition.Fade);
If(CountRows(CameraPhotos)>=1;UpdateContext({AddPhoto:Patch(SitePhotos;Defaults(SitePhotos);{PhotoId:Max(SitePhotos;PhotoId)+1;Photo:Last(FirstN(CameraPhotos;1)).Photo;ID:Gallery3.Selected.ID;Note:Text(Last(FirstN(CameraPhotos;1)).Note)})}));;
If(CountRows(CameraPhotos)>=2;UpdateContext({AddPhoto:Patch(SitePhotos;Defaults(SitePhotos);{PhotoId:Max(SitePhotos;PhotoId)+1;Photo:Last(FirstN(CameraPhotos;2)).Photo;ID:Gallery3.Selected.ID;Note:Text(Last(FirstN(CameraPhotos;2)).Note)})}));;
If(CountRows(CameraPhotos)>=3;UpdateContext({AddPhoto:Patch(SitePhotos;Defaults(SitePhotos);{PhotoId:Max(SitePhotos;PhotoId)+1;Photo:Last(FirstN(CameraPhotos;3)).Photo;ID:Gallery3.Selected.ID;Note:Text(Last(FirstN(CameraPhotos;3)).Note)})}));;
If(CountRows(CameraPhotos)>=4;UpdateContext({AddPhoto:Patch(SitePhotos;Defaults(SitePhotos);{PhotoId:Max(SitePhotos;PhotoId)+1;Photo:Last(FirstN(CameraPhotos;4)).Photo;ID:Gallery3.Selected.ID;Note:Text(Last(FirstN(CameraPhotos;4)).Note)})}));;
If(CountRows(CameraPhotos)>=5;UpdateContext({AddPhoto:Patch(SitePhotos;Defaults(SitePhotos);{PhotoId:Max(SitePhotos;PhotoId)+1;Photo:Last(FirstN(CameraPhotos;5)).Photo;ID:Gallery3.Selected.ID;Note:Text(Last(FirstN(CameraPhotos;5)).Note)})}));;
If(CountRows(CameraPhotos)>=6;UpdateContext({AddPhoto:Patch(SitePhotos;Defaults(SitePhotos);{PhotoId:Max(SitePhotos;PhotoId)+1;Photo:Last(FirstN(CameraPhotos;6)).Photo;ID:Gallery3.Selected.ID;Note:Text(Last(FirstN(CameraPhotos;6)).Note)})}));;
If(CountRows(CameraPhotos)>=7;UpdateContext({AddPhoto:Patch(SitePhotos;Defaults(SitePhotos);{PhotoId:Max(SitePhotos;PhotoId)+1;Photo:Last(FirstN(CameraPhotos;7)).Photo;ID:Gallery3.Selected.ID;Note:Text(Last(FirstN(CameraPhotos;7)).Note)})}));;
Navigate(EditInspectionScreen;ScreenTransition.Fade);;Clear(CameraPhotos))

 

Is there a way to change the filename from powerapps?
Or are you suggesting to change it manually?

v-micsh-msft
Community Support
Community Support

Hi @eXir,

 

Currently I can't find a way to change the image name saved by the camera control within PowerApps, the image name should be saved automatically.

And yes, here I suggest to change the name manually, for both the Excel data and the Image in the image folder.

Besides, I think it is a good idea for the camera control to have a property to rename the image saved.

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

carlosRodri
Frequent Visitor

Hola encontraste una solucion yo tambien estoy intentado hacer una cadena con datos y descripciones para agregarlos al nombre de la imagen y no encuentro la forma. me crea un GUI 

Anonymous
Not applicable

Buenas, yo tambien estoy buscando una solución, has encontrado algo para cambiar el nombre a las imagenes?

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (29,220)