cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarcusA
Regular Visitor

Incompatible type. Compilation issue?

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.




1 REPLY 1
MarcusA
Regular Visitor

Ended up taking an alternative approach,

If(
IsEmpty(
Filter(
Categories.Value,
!Not(Value in Property1Categories.Value)
)
),
Reset(Property1Control)
);


Patch('MyList', {Property1: Property1Control.Text, ....)


Annoying issue though.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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