cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
maxtarneberg
Advocate II
Advocate II

The requested operation is invalid. Server Response: A value must be provided for item

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

3 REPLIES 3
v-micsh-msft
Community Support
Community Support

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

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.

@v-micsh-msft

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

@v-micsh-msft

 

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,120)