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

Site Inspection - CameraScreen Explanation

Hi, just wondering if anyone could explain the CameraScreen Screen in the sample app "Site Inspection."

 

Specifically, I am having a hard time understanding the "Done" button (submitting the photos).

 

Thanks.

2 REPLIES 2
Lisabel0
Level 8

Re: Site Inspection - CameraScreen Explanation

After some testing, the onselect of the done buttuon is like this:

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))

 

As I took pictures in camera control, it will save all the images to the editform

 

ShanP
Level: Powered On

Re: Site Inspection - CameraScreen Explanation

UpdateContext({AddPhotoSmiley Tongueatch(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)})}));

 

 

Can you please explain/clarify this part? Thanks.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (2,183)