Hi folks,
I am getting this issue whilst patching photos with an app based on the Site Inspection template.
My 'Done' button on the camera screen has this slightly adapted code to log the indentifiers I need:
Where ID: Datacardvalue8 gives the Inspection ID, and BrowseGalerry1.Selected is the stock to log the inspection under.
If(NewRecord,Navigate(NewInspectionScreen,ScreenTransition.Fade), If(CountRows(CameraPhotos)>=1,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,1)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,1)).Note)})})); If(CountRows(CameraPhotos)>=2,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,2)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,2)).Note)})})); If(CountRows(CameraPhotos)>=3,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,3)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,3)).Note)})})); If(CountRows(CameraPhotos)>=4,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,4)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,4)).Note)})})); If(CountRows(CameraPhotos)>=5,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,5)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,5)).Note)})})); If(CountRows(CameraPhotos)>=6,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,6)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,6)).Note)})})); If(CountRows(CameraPhotos)>=7,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,7)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,7)).Note)})})); Navigate(EditInspectionScreen,ScreenTransition.Fade);Clear(CameraPhotos))
As per the template, I have ammeded the OnSuccess routine to match for the 'NewFormInspection' to:
If(CountRows(CameraPhotos)>=1,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,1)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,1)).Note)})})); If(CountRows(CameraPhotos)>=2,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,2)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,2)).Note)})})); If(CountRows(CameraPhotos)>=3,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,3)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,3)).Note)})})); If(CountRows(CameraPhotos)>=4,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,4)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,4)).Note)})})); If(CountRows(CameraPhotos)>=5,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,5)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,5)).Note)})})); If(CountRows(CameraPhotos)>=6,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,6)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,6)).Note)})})); If(CountRows(CameraPhotos)>=7,UpdateContext({AddPhoto:Patch(SitePhotos,Defaults(SitePhotos),{ID: DataCardValue8,Photo:Last(FirstN(CameraPhotos,7)).Photo,StockID: BrowseGallery1.Selected.StockUniqueID,Note:Text(Last(FirstN(CameraPhotos,7)).Note)})})); Navigate(DashboardScreen,ScreenTransition.Fade);ResetForm(FormNewInspection)
It is here that I am getting the error message.
Some details:
- I am using the template Collection and OneDrive as a data source.
- I don't need PhotoId (or do I?) like the template, as I don't use it to fill galleries, and use my InspectionID and StockID as identifiers.
- No columns anywhere are required to the best of my knowledge.
- My photos are successfully being saved in the data_images folder, however, new rows are not being added to the SitePhotos table in data.xlsx to reference the new photos.
- Cruxially this was all working before, so perhaps a change I've made elsewhere has caused this, but I have no idea how/where.
Ideally, I'd like to define the filename of the images myself also.
Where have I gone wrong?
Any help greatly appreciated, this is the last critical piece to my apps main functionality...
Max
Hi @maxtarneberg,
Take a try to perform a restore:
Restore an app to a previous version
The error message should be caused by missing values for special fields.
Regards,
Michael
Hi Michael,
Thank you for your suggestion.
However, I have of course made progress in other areas of the app, which may be antagonistic to the functionality I am trying to acheive here, but obviously I need all of the final features I am aiming at.
I was hoping for some broader understanding of the situation, in order to avoid a "2 steps back 1 step forward" approach.
As I said, this is saving photos in a folder but is not recording it down in the spreadsheet
Is there any other information I can provide to assist?
Thank you so far
Max
I attempted to restore to a previous version where photo details were last being recorded in my data.xlsx correctly.
Now I am finding that while it will record my various IDs in the data.xlsx, it is now putting the images down as blob e.g.
blob:A1F12FAB-78C2-*****-****-************ etc
and jpgs are no longer saved as they were before.
This is dumbfounding as this version was never doing this before. I haven't changed anything at all!!!
What on earth is going on?
Please help, I am at the edge of my tether
Thank you
Max
User | Count |
---|---|
229 | |
100 | |
97 | |
56 | |
33 |
User | Count |
---|---|
280 | |
110 | |
109 | |
63 | |
62 |