cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
FMeijer
Level: Powered On

Updating metadata of a photo collection from PowerApps

Hi Community,

 

I am building an App that enables users to make a collection of photo's (either from camera or from device), in the same app users have to add certain metadata (Location, kind of photo, kind of object). Then I want the whole collection to be sent to a Sharepoint Photo Library with the right metadata. I managed to build the app and make a collection with the right metadata. I build a flow that through a Parse JSON scheme can sent multiple photo's to the right Sharepoint Library, but somehow I can not update the file properties of each photo. The error message is:

 

InvalidTemplate. Unable to process template language expressions in action 'Update_file_properties' inputs at line '1' and column '2036': 'The template language expression 'triggerBody()['Updatefileproperties_Locatie']' cannot be evaluated because property 'Updatefileproperties_Locatie' doesn't exist, available properties are 'Initializevariable_Value'. Please see https://aka.ms/logicexpressions for usage details.'.
 
Below you see the screenshots of my flow, a screenshot of the metadata screen from my app and a screenshot of my collection. I think it has to do with my Parse JSON, but the output of my Parse JSON does name Location, Object and kind of photo. 
 
Flow1.pngFlow2.png
 
Collection.pngMetadata_screen.png
 
 
 
 
 
 
 
Hope someone can help!
 
 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Updating metadata of a photo collection from PowerApps

Hi @FMeijer 

 

Can you try to remove the flow from the button in PowerApps and register it again? It might be possible that changing the flow configuration afterwards is causing this issue. As I can see from your screenshots, there is no response action, so this should e resolved by registering the flow again.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Super User
Super User

Re: Updating metadata of a photo collection from PowerApps

Hi @FMeijer 

 

Yes, the new file overrides the existing file when you try to upload a new image with a same name. If you want to get the timestamp in your image name try to use the expression:
Collect(colPhotoFromCamera, {Name:Concatenate("Photo",Text(CountRows(colPhotoFromCamera)),"-", Text(now(), "[$-en-us]dd-mm-yyHHmmss"),".jpg"),Url:Camera1.Stream, Locatie: ddLocatie.Selected.Locatie, Object: ddObject.Selected.Value, Foto: ddSoortFoto.Selected.Value})
4 REPLIES 4
FMeijer
Level: Powered On

Re: Updating metadata of a photo collection from PowerApps

Ok, I adjusted my JSON schema to:

 

{
"type": "array",
"items": {
"type": "object",
"properties": {
"Name": {
"type": "string"
},
"Url": {
"type": "string"
},
"Object": {
"Type": "string"
},
"Locatie": {
"Type": "string"
},
"Foto": {
"Type": "string"
}
},
"required": [
"Name",
"Url",
"Object",
"Locatie",
"Foto"
]
}
}
 
This worked, I can now update file properties in the apply to each step. Somehow my upload button in powerapps is have issues now. This is the function:
CreateFilesSharepoint.Run(JSON(colPhotoFromCamera, JSONFormat.IncludeBinaryData))
The error message: CreateFilesSharepoint.Run failed: The data returned in the response is invalid.
 
I don't know what to do, why does it want data to be returned in the first place?
 
 
Super User
Super User

Re: Updating metadata of a photo collection from PowerApps

Hi @FMeijer 

 

Can you try to remove the flow from the button in PowerApps and register it again? It might be possible that changing the flow configuration afterwards is causing this issue. As I can see from your screenshots, there is no response action, so this should e resolved by registering the flow again.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
FMeijer
Level: Powered On

Re: Updating metadata of a photo collection from PowerApps

Hi @yashag2255 ,

 

Thanks for the solution, a new problem now occurs: if I upload photo1, photo2 photo 3 etc. everything works fine. But if I upload a new collection, my app overwrites the old photo's. I think this problem occurs, because the filename is the same. I tried fixing this with a time stamp, but the timestamp does not work. The date stamp does somehow.

 

any ideas why this is?

Super User
Super User

Re: Updating metadata of a photo collection from PowerApps

Hi @FMeijer 

 

Yes, the new file overrides the existing file when you try to upload a new image with a same name. If you want to get the timestamp in your image name try to use the expression:
Collect(colPhotoFromCamera, {Name:Concatenate("Photo",Text(CountRows(colPhotoFromCamera)),"-", Text(now(), "[$-en-us]dd-mm-yyHHmmss"),".jpg"),Url:Camera1.Stream, Locatie: ddLocatie.Selected.Locatie, Object: ddObject.Selected.Value, Foto: ddSoortFoto.Selected.Value})

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 121 members 4,533 guests
Please welcome our newest community members: