NEVER give your SharePoint fields the displayname of Value!

After an hour of banging my head against a brick wall when my Patch command failed I found the issue with a field named Value.

Value

It is not uncommon to call a field Value inn SharePoint. For example when you want to keep track of the Value of products you might think that Value is a good name. But it is not if you use Power Apps in combination with SharePoint.

The word Value is a reserved word in Power Apps as you might have found before. But what if your datasource uses a field called Value? Will things get confused?

Today I tried the following code:

Patch(
    'Gift, Hospitality and Donation Register',
    Defaults('Gift, Hospitality and Donation Register'),
    {
        TSTType: {            
            Value: First(cmbType.SelectedItems).Value
        },
        TSTValue: 123
    }
)

All looks good but Power apps is complaining that something is missing with the following warnings:

Invalid argument type.Expecting a Record value, but of a different schema. 
missing column. Your formula is missing a column 'Value' with the type of Text

When you search for the above warnings your will end up on community posts where people have used the wrong syntax or when they are doing something else wrong. Or on my post about patching any type of field.

Fixing the column name

But to make matters worse! When you update the list’s column display name to for example Amount and then update your datasource. You will find that Power apps is trying to be very helpful! And all your “Value:” bits in your code will be updated.

NEVER give your SharePoint fields the displayname of Value! Microsoft Office 365 image 4

Recommendations

So my recommendation:

Never call your fields Value. And that includes the displayname of a column. Well that is until Microsoft fixes this issue.

Continue Reading Pieter Veenstra’s Article on their blog

NEVER give your SharePoint fields the displayname of Value!

After an hour of banging my head against a brick wall when my Patch command failed I found the issue with a field named Value. It is not uncommon to call a field Value inn SharePoint. For example when you want to keep track of the Value of products you might think that Value is a good name.

Blog Syndicated with Pieter Veenstra’s Permission

Author: Pieter Veenstra

Share This Post On
Share via
Copy link
Powered by Social Snap