I have an app where i am using patch to create new records. I am updating different fields based on what properties the user has selected they want to update based on a set of categories.
Datatypes:
Categories : Collection of Text
Property1Categories: Collection of Text
The following is part of the OnSelect of my "Save" Button:
Set(UpdateVar,{Category: Categories, Date: Date.SelectedDate, Note:Note.Text});
If(
!IsEmpty(
Filter(
Categories.Value,
!Not(Value in Property1Categories.Value)
)
),
Set(UpdateVar,Patch(UpdateVar,{Property1: Property1Control.Text}))
);
Patch('MyList', UpdateVar)
(There are about 15 properties like this, of different formats, Text, Number, Date, Person, Choice)
This gives me an error ON STARTUP but if i make some alterations to the code and revert them, it compiles without errors and populates the list when i run it.
Error:
Incompatible type. We can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app.