1
votes

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.

enter image description here

enter image description here

1

1 Answers

0
votes

For some columns with names that contains characters that are not letters or numbers (such as _prospect), SharePoint will often use a different name for it. In your case, if you select the card in the customization pane and look at the advanced properties, you should see which name SharePoint gave your column in the DataField property.

For example, I added a _prospect field to one of my SPO lists, and SharePoint named it OData__prospect (see below).

enter image description here

If this is the same for you, in your Patch statement you can use something like this:

Patch(
    Interactions,
    Defaults(Interactions),
    {
        OData__prospect : "moon child"
    })