cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

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({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)})}));
If(CountRows(CameraPhotos)>=2,UpdateContext({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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

 

Super User
Super User

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

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

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 55 members 4,217 guests
Please welcome our newest community members: