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.

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,968)