cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AJL47
New Member

Patching a record in Sharepoint

I am trying to create a simple form for users to update a sharepoint list when they review a document.  They are choosing the document from a filtered gallery based on Document Number and Title.   I have set current User in the App OnStart property.

 

Set(_CurrentUser, User())

 

And I have the DefaultDate set to "Today()" in the DatePicker1 element.

 

I've managed to narrow down what is giving me an error, to two elements(Removing them allows the form to submit).  I just can't figure out how to get them to work.

 

"ProcedureIsAccurate: Radio1.Selected.Record,
Reviewer: 'Current User_1'.Text,"

 

Here is the Gallery control that takes you to the form and sets the variable

GalleryControl.PNG

 

And here is the OnSelect property of the form.

SubmitButtonCode.PNG

 

And finally, here is the List settings of the sharepoint

ListSettings.PNG

 

Thanks for any help.

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

@AJL47 

The syntax for the 2 parts that don't work would look like this:

ProcedureIsAccurate:{
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
  Value:Radio1.Selected.Record
},
Reviewer:{
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
  Claims:Concatenate("i.0#.f|membership|",_CurrentUser.Email),
  Email:"",
  Department:"",
  DisplayName:"",
  JobTitle:"",
  Picture:""
}

This is based on the assumption that Radio1.Selected.Record returns the text value for your choice column, so you might want to double check that.

View solution in original post

9 REPLIES 9
timl
Super User
Super User

@AJL47 

The syntax for the 2 parts that don't work would look like this:

ProcedureIsAccurate:{
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
  Value:Radio1.Selected.Record
},
Reviewer:{
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
  Claims:Concatenate("i.0#.f|membership|",_CurrentUser.Email),
  Email:"",
  Department:"",
  DisplayName:"",
  JobTitle:"",
  Picture:""
}

This is based on the assumption that Radio1.Selected.Record returns the text value for your choice column, so you might want to double check that.

This did make some forward progress.  But on the validation I got an error that it didn't save.  I'm the one that created the Sharepoint List, so I'm not sure why it would say membership could not be found.

Could this be a problem with the Label using "User().FullName" as the "Text"?

InvalidOperation.PNG

 

timl
Super User
Super User

@AJL47 

Yes, Email is what you need to provide, rather than Full Name, to set the value of person column. Email is a unique identifier, whereas Full Name isn't.

Okay so this is where I may need a little more handholding.

 

App-Onstart is set to "Set(_CurrentUser, User())"

 

I changed Current User_1 Text to "User().Email" and I'm still getting the error.

timl
Super User
Super User

@AJL47 

To diagnose this further, I would try hardcoding your email address into the Claims section like so.  Do you still get the error "the specified user could not be found"?

Reviewer:{
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
  Claims:"i.0#.f|membership|yourname@yourdomain.com",
  Email:"",
  Department:"",
  DisplayName:"",
  JobTitle:"",
  Picture:""
}

 

No, now I'm getting "Invalid Argument type. expecting a Record value, but of a different schema"

timl
Super User
Super User

That's strange. If you try hardcoding your email using the syntax beneath (which didn't previously cause an incorrect schema error), does that still return an incorrect schema error?

Reviewer:{
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
  Claims:Concatenate("i.0#.f|membership|","EnterYourEmailHere@YourDomain.com"),
  Email:"",
  Department:"",
  DisplayName:"",
  JobTitle:"",
  Picture:""
}

 

Now it is back to "Specified user could not be found"

 

I'm thinking I might just switch the Person column in SP to Text and not worry about the Person field.  I don't actually need it linked, and Sharepoint is tracking via "modified by" anyways.

 

Thank you so much for your help.  I'll accept up top as solution.   You've gotten me through a log jam I've been fighting for days.

timl
Super User
Super User

You're welcome @AJL47 

With the person column, it doesn't seem to recognise the user based on the email address which is quite difficult to diagnose. I agree that switching to a text column is probably the easiest solution right now.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,022)