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

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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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({AddPhotoSmiley Tongueatch(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
Community Support Team
Community Support Team

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

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.
maxtarneberg
Level: Powered On

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

@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

maxtarneberg
Level: Powered On

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

@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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

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!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 254 members 3,918 guests
Please welcome our newest community members: