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

Patch invalid use of '.' error I just can't get past

I am stuck and can't get patch to update the status of a record when a button is selected.

Quick overview and user submit a request via Forms, the responses go into flow which adds it to a sharepoint list and sends approvals to different people based on various field entries. 

 

The app kicks in when a user recieves an approval request & clicks the link to view & update the item before approving/rejecting. Clicking the link takes them directly to the item vs to a gallery where they could potentially see items assigned to other people. 

 

I have a button that I want users to click on when they are ready to "Re-Submitt" a request. This should update the sharepoint list's status to "Re-Submitted" 

 

OnSelect I have:

Patch('Encompass Urgent Requests',SharePointIntegration.SelectedListItemID.value,{Status:"Re-Submitt"})

 

The error I'm getting is an invalid use of '.' 

 

Thanks in advance for any help! 

 

 

10 REPLIES 10
shailendra74
Level 10

Re: Patch invalid use of '.' error I just can't get past

Hi @Jessica_A 

 

Update the Patch method as:

 

Patch('Encompass Urgent Requests', SharePointIntegration.Selected, {Status:"Re-Submitt"})

Thanks.

Jessica_A
Level: Powered On

Re: Patch invalid use of '.' error I just can't get past

I've gone in circles with getting it to pick up the record ID I'm on, if I remove the .value then I get the error message:

The type of this argument 'status' does not match the expected type 'Record'. Found type 'text'.

shailendra74
Level 10

Re: Patch invalid use of '.' error I just can't get past

Hi @Jessica_A 

 

Is the "Status" field Lookup or Choice field?

 

Thanks.

Jessica_A
Level: Powered On

Re: Patch invalid use of '.' error I just can't get past

It's a dropdown so a choice field, however custom values are enabled (Re-Submitted is not a custom value however). 

shailendra74
Level 10

Re: Patch invalid use of '.' error I just can't get past

Hi @Jessica_A 

 

If allow multi selection is checked:

 

Patch('Encompass Urgent Requests', SharePointIntegration.Selected, { 
Status: Table( { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Value: DataCardValue2.Selected.Value } ) )

 

If single value selection:

 

 

Patch('Encompass Urgent Requests', SharePointIntegration.Selected, {
Status: { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Value: DataCardValue2.Selected.Value } )

 

 

DataCardValue2 - is the dropdown control name for selecting

 

Thanks.

 

Gidrone_NS
Level: Powered On

Re: Patch invalid use of '.' error I just can't get past

@Jessica_A 

 

You don't need .value after SharePointIntegration.SelectedListItemID because it return ID of last items in list.

 

If you need to Patch SharePoint last submited item, then you need to use OnSuccess property of form with SharePointForm1.LastSubmit.Status 

 

Jessica_A
Level: Powered On

Re: Patch invalid use of '.' error I just can't get past

@shailendra74 

 

I'm still hitting the wall on this one. 

 

Instead of the '.' error, now I get an error saying: Unexpected characters. The formula contains 'CurlyClose' where 'ParentClose' is expected. 

 

--

Side note, I also tried to just update a different text field instead figuring I could update the value in flow on change if I can't get it to work in power apps, I don't get an error but when I preview the function it doesn't update the field either. 

 

OnSelect

Patch('Encompass Urgent Requests',SharePointIntegration.Selected,{'Manager Comments':"true"})

 

Not sure if this is part of the issue, but the button is nested outside of the form but still on the same screen, I have other buttons in the same section that function correctly, but those aren't running a patch. 

 

 

shailendra74
Level 10

Re: Patch invalid use of '.' error I just can't get past

Hi @Jessica_A 

 

The earlier status field you mentioned was choice field. The field now you shared 'Manager Comments' is this a single line text field?

 

Also the code which I gave earlier a button is placed on the screen and onSelect, I call patch() method.  Even for below code you mentioned, I don't see issue.considering manager comments is a single line text.

 

Thanks.

Jessica_A
Level: Powered On

Re: Patch invalid use of '.' error I just can't get past

@shailendra74 

Manager Comments is a single text field. 

 

I think the issue is the record ID. I tried another workaround of having the button trigger flow, and then have flow update the item. When I do that, powerapps runs without error, buy my flow fails because powerapps is sending over the record ID of 1 every time (that record has been deleted from the sharepoint list, hence the fail)

 

To launch the flow I used:

ResubmittForApproval.Run(SharePointIntegration.Selected)

I also tried:

ResubmittForApproval.Run(SharePointIntegration.SelectedListItemID)

--

My form's data source is correctly set for the list name, and the item is set as:

If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First('Encompass Urgent Requests'),SharePointIntegration.Selected)

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,786)