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

Can't save a new record to SharePoint online (office) list

Good day, 

 

I have a online SharePoint List called Interactions (screenshot) attached. After various failed attempts to set a default value to a dropdown (Choice) list, I tried to create my own Patch function. (I receive a global variable from the previous screen called 'varCompanyName' and I can set a text_control to that field so I know the value is passed correctly.) I started trying to save just 1 column to my SharePoint List called Interactions - '_prospect' but in my formula field of the onSelect of my button control complains that it can't find the column = '_prospect'. I've tried appending it with OData__ as in "OData__prospect" (1 and 2 underscores). I don't understand at all how to save 1 record back to my Interactions table. A complete record should write something back like:

Patch(Interactions, Defaults(Interactions), {_date : OData__date__dateCard3.selected, _prospect : OData__prospect_prospectCard3.select, etc etc }) But it complains about the column not being found so I can't even save manual values like {_prospect : "moon child"} let alone grab the values from the controls (next challenge) i.e {_prospect: dropdown.selected} etc. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @HelpWebUJ,

 

First of all, I would like to confirm a few things:

1. So you have the columns in your sharepoint list named exactly with "_date" and "_prospect"? 

2. What are the column types of all these columns? I guess that "_prospect" is a Choice column, if so, then you cannot simply use a "Dropdown.Selected.Value" formula to Patch it to SharePoint list. To Patch a Choice column, you need something like this:

Patch(
    MyList,
    MyRecord,
    {MyChoiceColumn:
        {
        Value: Dropdown1.Selected.Value,
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}
        }
    )

For how to patch choice and lookup type columns, please refer to:

https://baizini-it.com/blog/index.php/2018/01/15/powerapps-how-to-update-sharepoint-choice-and-looku...

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-monli-msft
Community Support
Community Support

Hi @HelpWebUJ,

 

First of all, I would like to confirm a few things:

1. So you have the columns in your sharepoint list named exactly with "_date" and "_prospect"? 

2. What are the column types of all these columns? I guess that "_prospect" is a Choice column, if so, then you cannot simply use a "Dropdown.Selected.Value" formula to Patch it to SharePoint list. To Patch a Choice column, you need something like this:

Patch(
    MyList,
    MyRecord,
    {MyChoiceColumn:
        {
        Value: Dropdown1.Selected.Value,
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}
        }
    )

For how to patch choice and lookup type columns, please refer to:

https://baizini-it.com/blog/index.php/2018/01/15/powerapps-how-to-update-sharepoint-choice-and-looku...

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,805)