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

Patch of a choice column from a dropdown selection

Good morning,

 

I've scoured the boards for solutions and can't seem to find anything for my specific situation. This is a canvas app form feeding a SharePoint site.

 

I have one choice column that has the choices built into the form that is showing an error in the patch. Without it everything works fine, but when I add in the section for the choice column I get red squiggles. 

 

This is the section for the choice column that isn't working:

 

/*****Choice Column******/
OnsiteorDeskAudit: Dropdown_Location.Selected, {'@odata.type':""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
ID:'1',
Value:"Onsite"},

 

The italicized parts are the ones showing the error:

  • Expected operator. We expect an operator such as +, *, or & at this point in the formula

Everything after the comma has the red underlining also, but I think it's related to this portion not working. 

 

This is the full patch for reference:

 

Patch( 'SPListName',Defaults('SPListName'),
{
/******Single line of text columns******/
RecipientName: Recipient.Text,
GAT: GAT.Text,
AuthorizationID: Authorization.Text,
Reviewer: Reviewer.Text,

 

/*****Master List Columns******/
State: Dropdown_State.Selected,
Office: Dropdown_Office.Selected,
BusinessArea: Dropdown_BusinessArea.Selected,

 

/*****Date Column*****/
DateScheduled: DateScheduled.SelectedDate,

 

/*****Location Column******/
OnsiteorDeskAudit: Dropdown_Location.Selected, {'@odata.type':""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
ID:'1',
Value:"Onsite"},

};
Navigate(Completion, Fade))

 

Any assistance is appreciated. 

 

@BCBuizer solution worked, with a slight modification - 

 

Patch(
'SPList',
Defaults('SPList'),
{
/******Single line of text columns******/
RecipientName: Recipient.Text,
GAT: GAT.Text,
Authorization: Authorization.Text,
Reviewer: Reviewer.Text,

 

/*****Master List Columns******/
State: Dropdown_State.Selected.Result,
Office: Dropdown_Office.Selected.Result,
BusinessArea: Dropdown_BusinessArea.Selected.Result,

 

/*****Date Column*****/
DateScheduled: DateScheduled.SelectedDate,

 

/*****Choice Column******/
OnsiteorDeskAudit: Dropdown_Location.Selected
}
);
Navigate(Completion, Fade)

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

Hi @C_Salm ,

 

I found some syntax mistakes in your code:

- No closing bracket for the Patch function

- comma after the last argument in the Patch function.

 

Perhaps those are causing you to believe there is an issue with trying to patch the choice column.

 

Try the below please:

 

Patch(
	'SPListName',
	Defaults('SPListName'),
	{
	/******Single line of text columns******/
	RecipientName: Recipient.Text,
	GAT: GAT.Text,
	AuthorizationID: Authorization.Text,
	Reviewer: Reviewer.Text,

	/*****Master List Columns******/
	State: Dropdown_State.Selected,
	Office: Dropdown_Office.Selected,
	BusinessArea: Dropdown_BusinessArea.Selected,

	/*****Date Column*****/
	DateScheduled: DateScheduled.SelectedDate,

	/*****Location Column******/
	OnsiteorDeskAudit: Dropdown_Location.Selected
	}
);
Navigate(Completion, Fade)


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

4 REPLIES 4
NandiniBhagya20
Solution Sage
Solution Sage

Hi @C_Salm ,

Try removing below part (which is causing error) from your formula - 

{'@odata.type':""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
ID:'1',
Value:"Onsite"},


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

BCBuizer
Super User
Super User

Hi @C_Salm ,

 

I found some syntax mistakes in your code:

- No closing bracket for the Patch function

- comma after the last argument in the Patch function.

 

Perhaps those are causing you to believe there is an issue with trying to patch the choice column.

 

Try the below please:

 

Patch(
	'SPListName',
	Defaults('SPListName'),
	{
	/******Single line of text columns******/
	RecipientName: Recipient.Text,
	GAT: GAT.Text,
	AuthorizationID: Authorization.Text,
	Reviewer: Reviewer.Text,

	/*****Master List Columns******/
	State: Dropdown_State.Selected,
	Office: Dropdown_Office.Selected,
	BusinessArea: Dropdown_BusinessArea.Selected,

	/*****Date Column*****/
	DateScheduled: DateScheduled.SelectedDate,

	/*****Location Column******/
	OnsiteorDeskAudit: Dropdown_Location.Selected
	}
);
Navigate(Completion, Fade)


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

That's what I had started with, and that I've used before in other forms with no problems, and everything gets red squiggles with the error: The type of this argument 'Title' does not match the expected type 'Text'. Found type 'Record'. 

BCBuizer
Super User
Super User

Hi @C_Salm ,

 

I see you marked my reply as the solution, yet in your response you state there is still an issue. Has this now been resolved?

 

Edit: I see you updated the opening post, thanks



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,564)