
Announcements
Hello there.
I am building a Power App and i have general and specific questions. App will be mostly used from a mobile device:
1) I need for users to be able to hit a button and select to take a picture or select from phone's gallery. This can be done by camera, add picture or both media options?
2) My app is designed for surveys. So, i will create surveys and in each survey I will select a location from a drop down and then add pictures and add a tag per picture. I have a list called Surveys and a document library called SurveyPhotos.
App has a drop down called locations, an add Picture button called Addphotos, a vertical library called Myphotos and a button to upload photos to SP.
Addphotos button has in on select state:
Collect(myPhotos,{Name:AddMediaButton1.FileName, Pic:UploadedImage1.Image, FileName:Concatenate("file",Text(CountRows(myPhotos)),".jpg") })
Image in vertical library has ThisItem.Pic value and title in vertical library has value ThisItem.Name, I also added in vertical library a text input called imagetag.
Till now everything is working when tested.
As for the import i created a flow with these steps:
1 - Power Apps (blank)
2 - Parse JSON
Content: parseJSON_Content
Schema:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"Name": {
"type": "string"
},
"Pic": {
"type": "string"
},
"Tag": {
"type": "string"
},
"location": {
"type": "string"
}
},
"required": [
"Name",
"Pic"
]
}
}
3 - Apply to each
Select output from previous stages: Body
Create file: Inside this step i entered my website and Document Library and in File Name i entered Name (from json) and in file content i put Pic (from json)
Update file properties: Inside this step i entered my website and Document Library and:
Id: ItemId
SurveyID: ItemId
Tag: Tag (from json)
Location: Location (from json)
Flow saved as JSONFlow.
Then in my app in the onSelect property of upload button i use this:
Set(theaction, JSON(MyPhotos, JSONFormat.IncludeBinaryData));JSONFlow.Run(theaction,imagetag.Text,locations.Selected.Name);
When i try this i see images being uploaded on my document library. Location is there but all images have last(or first) image's tag. Any ideas?
Also can i somehow before uploading to create the survey in order to use its id in each uploaded image's data? in my doc library i have a column called surveyid
Many thanks in advance