cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Level 8

Site Inspection Template

Hello there,

 

I have a quick question for this template:

 

I really appreciate  if someone could provide guidance here:

 

When the app is adding the collection this is the code:

 

If(NewRecord,UpdateIf(CameraPhotos, PhotoId=ImageRecord.PhotoId,{Note:AddNoteText.Text}),UpdateIf(SitePhotos,PhotoId=ImageRecord.PhotoId,{Note:AddNoteText.Text}));If(NewRecord,Navigate(NewInspectionScreen,ScreenTransition.None),Navigate(EditInspectionScreen,ScreenTransition.None))

 

I have some extra columns added and I would like to add the new values to this collection, but I am getting invalid name:

 

If(NewRecord,UpdateIf(CameraPhotos, PhotoId=ImageRecord.PhotoId,{Note:AddNoteText.Text,New1:AddNew1.Text,New2:AddNew2,New3:AddNew3.Text,New4:AddNew4,New5:AddNew5}),UpdateIf(SitePhotos,PhotoId=ImageRecord.PhotoId,{Note:AddNoteText.Text,New1:AddNew1.Text,New2:AddNew2,New3:AddNew3.Text,New4:AddNew4,New5:AddNew5}));If(NewRecord,Navigate(NewInspectionScreen,ScreenTransition.None),Navigate(EditInspectionScreen,ScreenTransition.None))

 

Thanks in advance for any response

4 REPLIES 4
sajarac
Level 8

Re: Site Inspection Template

And another question: Why the Map / GPS is not working in the sample?

 

If(Gallery1.Selected.IsGPSCoordinates = "False","http://dev.virtualearth.net/REST/V1/Imagery/Map/Road/"&Concatenate(Gallery1.Selected.Address," ",Gallery1.Selected.City," ",Gallery1.Selected.State)&"?key=wg9mvoY3hN6AVoUPutnZ~y8lVN1szjh6d5E8Vs8h48A~AtTHu5h2www6JiWYy5l3eKT8Cfl7SDg4f4jJUiwVL9beAGFEPcLyCe2iBvkF--_9","http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/"&Gallery1.Selected.Latitude&","&Gallery1.Selec...")

Community Support Team
Community Support Team

Re: Site Inspection Template

Hi @sajarac,

 

The new fields should be first created under the Excel table, once the related column has been added, you may need to delete the Excel table connection and add it again within PowerApps Editor from the Source (For exmaple, OneDrive for Business).

 

For the Map issue, any error messages that could be shared here?

Please follow the blog below for the details about how to work with the Map in PowerApps:

Displaying a Map using an Image Control in PowerApps and Bing Maps or Google Maps API

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
sajarac
Level 8

Re: Site Inspection Template

Hello @v-micsh-msft, I have followed your instructions, I added the new fields to my excel file, deleted the conenction and added the file again, so far so good.

 

Now could you please let me know how can I get the extra fields be patched into the cameraphotos colection? I guess this is the formula that does it, but I don't know:

 

Thanks in advance

 

If(!IsBlank(NewAddressText.Text)&&!IsBlank(NewCityText.Text)&&!IsBlank(NewZipText.Text)&&!IsBlank(NewStateText.Text)&&!IsBlank(NewTitleText.Text)&&!IsBlank(NewSubTitleText.Text)||!IsBlank(NewTitleText.Text)&&!IsBlank(NewSubTitleText.Text)&&Radio1_4.Selected.Value="Use GPS for current Location",If(CountRows(CameraPhotos)>=1,UpdateContext({AddPhotoSmiley Tongueatch(SitePhotos,Defaults(SitePhotos),{PhotoId:Max(SitePhotos,PhotoId)+1,Photo:Last(FirstN(CameraPhotos,1)).Photo,ID:Max(SiteInspector,ID)+1,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:Max(SiteInspector,ID)+1,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:Max(SiteInspector,ID)+1,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:Max(SiteInspector,ID)+1,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:Max(SiteInspector,ID)+1,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:Max(SiteInspector,ID)+1,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:Max(SiteInspector,ID)+1,Note:Text(Last(FirstN(CameraPhotos,7)).Note)})}));
UpdateContext({AddRecordSmiley Tongueatch(SiteInspector,Defaults(SiteInspector),{ID:Max(SiteInspector,ID)+1,Title:NewTitleText.Text,SubTitle:NewSubTitleText.Text,Notes:NewNotesText.Text,Description:NewDescriptionText.Text,Address:NewAddressText.Text,City:NewCityText.Text,Zip:Text(NewZipText.Text),State:NewStateText.Text,Latitude:If(Radio1_4.Selected.Value="Use GPS for current Location",Text(Location.Latitude),""),Longitude:If(Radio1_4.Selected.Value="Use GPS for current Location",Text(Location.Longitude) ,""),IsGPSCoordinates:If(Radio1_4.Selected.Value="Use GPS for current Location","True","False")})});Navigate(DashboardScreen,ScreenTransition.None));If(IsBlank(NewTitleText.Text)||IsBlank(NewSubTitleText.Text)||IsBlank(NewAddressText.Text)||IsBlank(NewCityText.Text)||IsBlank(NewStateText.Text)||IsBlank(NewZipText.Text) ,UpdateContext({Required:true}),UpdateContext({Required:false}))

sajarac
Level 8

Re: Site Inspection Template

Hello there, this is the ultimate list of ToDo's after your advice and several youtube videos:

 

Basically I have the following Questions:

 

1. In the follwoing formula the number 7 means that this app only can capture up to 7 pictures per record?

 

If(CountRows(CameraPhotos)>=7,UpdateContext({AddPhoto Patch(SitePhotos,Defaults(SitePhotos),{PhotoId:Max(SitePhotos,PhotoId)+1,Photo:Last(FirstN(CameraPhotos,7)).Photo,ID:Max(SiteInspector,ID)+1,Note:Text(Last(FirstN(CameraPhotos,7)).Note)})}));

 

If so, and if I want to change that value for instance 10 picures, should I need to add more commands por the "+" button and Done button?

1.PNG

 

 

2. I would like to add individuals values to each photo but I can not find the way to do this, I mean ADD values to the colection. and once you click in the "EDIT" edit those values

 

3.png

 

Thank in advance for any guidance here.

 

Regards,

 

 

 

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: 44 members 4,518 guests
Please welcome our newest community members: