Value issues in Power Apps

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.

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as a Principal Architect at HybrIT Services Ltd. You can contact me using contact@sharepains.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue Reading

%d bloggers like this: