To update the EXIF GPS metadata of an image in Power Apps, you can use the following approach:
After the user takes a photo with the "AddMediaButton", store the image in a temporary collection. You can do this by setting the Items property of a collection to the result of the AddMediaButton control:
ClearCollect(TempImageCollection, AddMediaButton1.Media)
Add a button to your app that the user can click to add geolocation data to the image.
On the OnSelect property of the button, use the Patch function to update the EXIF GPS metadata of the image in the TempImageCollection.
Patch(
TempImageCollection,
First(TempImageCollection),
{
GPSLatitude: YourLatitudeValue,
GPSLongitude: YourLongitudeValue
}
)
Replace YourLatitudeValue and YourLongitudeValue with the actual latitude and longitude values that you want to set.
After the GPS coordinates are added to the TempImageCollection, you can use the SaveBinary function to save the image with the updated EXIF GPS metadata to SharePoint:
SaveBinary(
AddMediaButton1.Media,
"SharePointSiteName",
"Shared Documents/FolderName/FileName.jpg",
true
)
Replace SharePointSiteName with the name of your SharePoint site, FolderName with the name of the folder where you want to save the image, and FileName.jpg with the name that you want to give the image.
With these steps, you should be able to update the EXIF GPS metadata of the image before uploading it to SharePoint.