web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can't Evaluate your fo...
Power Apps
Unanswered

Can't Evaluate your formula because the context variable types are incompatible with the types of values in other places

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

In my app, I am pulling back a few SPO multitext columns.

I made some changes in the SPO list.  I deleted the four columns and created four new ones with different names.

They were single lines of text.  When I first saw the error, I changed the new columns to multiline text, but it made no difference.

I am just storing text in the columns so I am not sure why it is throwing this error all of a sudden.  It is causing the entire OnStart part of the app not to run.

Here is the code BEFORE I deleted the columns:

 

ClearCollect(CollectHours,LookUp(Engineers,UPN = User().Email,AssignmentHours));
ClearCollect(CollectWorkHours,LookUp(Engineers,UPN = User().Email));
Set(var_engineer,LookUp(Engineers, UPN = User().Email));
Set(var_engineerDays,var_engineer.AssignmentDays);
Set(var_engineerWorkDaysPA,var_engineer.WorkDaysPowerApp);
Set(var_TimeZone,"UTC"
& If(TimeZoneOffset() > 0, "-", "+")
& RoundDown(Abs(TimeZoneOffset()) / 60, 0)
& ":"
& If(Mod(Abs(TimeZoneOffset()), 60) < 10, "0", "")
& Mod(Abs(TimeZoneOffset()), 60));
Set(var_Hour,Hour(Now()));
If(Weekday(Now(),StartOfWeek.Monday)=7,Set(var_CurrentDay,0));
If(Weekday(Now(),StartOfWeek.Monday)=1,Set(var_CurrentDay,1));
If(Weekday(Now(),StartOfWeek.Monday)=2,Set(var_CurrentDay,2));
If(Weekday(Now(),StartOfWeek.Monday)=3,Set(var_CurrentDay,3));
If(Weekday(Now(),StartOfWeek.Monday)=4,Set(var_CurrentDay,4));
If(Weekday(Now(),StartOfWeek.Monday)=5,Set(var_CurrentDay,5));
If(Weekday(Now(),StartOfWeek.Monday)=6,Set(var_CurrentDay,6));
If(CurrentTimeZone.Text = "UTC-8:00",Set(var_hours,ForAll(CollectHours,Sum(Value)-2)));
If(CurrentTimeZone.Text = "UTC-7:00",Set(var_hours,ForAll(CollectHours,Sum(Value)-1)));
If(CurrentTimeZone.Text = "UTC-5:00",Set(var_hours,ForAll(CollectHours,Sum(Value,1))));
If(CurrentTimeZone.Text = "UTC-6:00",Set(var_hours,ForAll(CollectHours,Sum(Value,0))));
If(CurrentTimeZone.Text = "UTC-8:00",Set(var_EnginerQueueTimes,var_engineer.WorkHours_x002d_Pacific));
If(CurrentTimeZone.Text = "UTC-7:00",Set(var_EnginerQueueTimes,var_engineer.WorkHours_x002d_Mountain));
If(CurrentTimeZone.Text = "UTC-5:00",Set(var_EnginerQueueTimes,var_engineer.WorkHours_x002d_Eastern));
If(CurrentTimeZone.Text = "UTC-6:00",Set(var_EnginerQueueTimes,var_engineer.WorkHours_x002d_Central));
Set(var_InQueueVisible,false);
If(CurrentHour.Text in Split(ConvertedHours.Text, ",") && CurrentDay.Text in Split(Label_AssignmentDays.Text, ","),Set(var_InQueueVisible,true));
NewForm(AddCasaeEditForm);Navigate(AddCaseScreen, ScreenTransition.None);

 

You can see the section where I removed the columns (this same exact batch of code is located in another spot, so i was able to copy and paste).

 

If(CurrentTimeZone.Text = "UTC-8:00",Set(var_EnginerQueueTimes,var_engineer.WorkHours_x002d_Pacific));
If(CurrentTimeZone.Text = "UTC-7:00",Set(var_EnginerQueueTimes,var_engineer.WorkHours_x002d_Mountain));
If(CurrentTimeZone.Text = "UTC-5:00",Set(var_EnginerQueueTimes,var_engineer.WorkHours_x002d_Eastern));
If(CurrentTimeZone.Text = "UTC-6:00",Set(var_EnginerQueueTimes,var_engineer.WorkHours_x002d_Central));

 

I removed those SPO columns and created new ones.  When I change the column in the code, two things happen.

When I go to change var_engineer.QueueShift-Pacific.......the column shows up with ' at the front and ' back.

Before it was not doing that.

 

lardo5150_1-1645880900725.png

Once I choose the correct column for each piece of the code, I then get the error.

I have NO idea why this is happening, as all I did was change the columns in SPO.

 

lardo5150_0-1645880824359.png

 

Code after

 

Set(var_DisplayName,LookUp(Engineers, UPN=User().Email,EngineerDisplayName));
Set(var_EngineerTitle,Office365Users.MyProfile().JobTitle);
ClearCollect(CollectHours,LookUp(Engineers,UPN = User().Email,AssignmentHours));
ClearCollect(CollectWorkHours,LookUp(Engineers,UPN = User().Email));
Set(var_engineer,LookUp(Engineers, UPN = User().Email));
Set(var_engineerDays,var_engineer.AssignmentDays);
Set(var_engineerWorkDaysPA,var_engineer.WorkDaysPowerApp);
Set(var_TimeZone,"UTC"
& If(TimeZoneOffset() > 0, "-", "+")
& RoundDown(Abs(TimeZoneOffset()) / 60, 0)
& ":"
& If(Mod(Abs(TimeZoneOffset()), 60) < 10, "0", "")
& Mod(Abs(TimeZoneOffset()), 60));
Set(var_Hour,Hour(Now()));
If(Weekday(Now(),StartOfWeek.Monday)=7,Set(var_CurrentDay,0));
If(Weekday(Now(),StartOfWeek.Monday)=1,Set(var_CurrentDay,1));
If(Weekday(Now(),StartOfWeek.Monday)=2,Set(var_CurrentDay,2));
If(Weekday(Now(),StartOfWeek.Monday)=3,Set(var_CurrentDay,3));
If(Weekday(Now(),StartOfWeek.Monday)=4,Set(var_CurrentDay,4));
If(Weekday(Now(),StartOfWeek.Monday)=5,Set(var_CurrentDay,5));
If(Weekday(Now(),StartOfWeek.Monday)=6,Set(var_CurrentDay,6));
If(CurrentTimeZone.Text = "UTC-8:00",Set(var_hours,ForAll(CollectHours,Sum(Value)-2)));
If(CurrentTimeZone.Text = "UTC-7:00",Set(var_hours,ForAll(CollectHours,Sum(Value)-1)));
If(CurrentTimeZone.Text = "UTC-5:00",Set(var_hours,ForAll(CollectHours,Sum(Value,1))));
If(CurrentTimeZone.Text = "UTC-6:00",Set(var_hours,ForAll(CollectHours,Sum(Value,0))));
If(CurrentTimeZone.Text = "UTC-8:00",Set(var_EnginerQueueTimes,var_engineer.'QueueShift-Pacific'));
If(CurrentTimeZone.Text = "UTC-7:00",Set(var_EnginerQueueTimes,var_engineer.'QueueShift-Mountain'));
If(CurrentTimeZone.Text = "UTC-5:00",Set(var_EnginerQueueTimes,var_engineer.'QueueShift-Eastern'));
If(CurrentTimeZone.Text = "UTC-6:00",Set(var_EnginerQueueTimes,var_engineer.'QueueShift-Central'));
Set(var_InQueueVisible,false);
If(CurrentHour.Text in Split(ConvertedHours.Text, ",") && CurrentDay.Text in Split(Label_AssignmentDays.Text, ","),Set(var_InQueueVisible,true));
Refresh(Engineers);

Set(var_VersionNumber,"v5.0.2");

Categories:
I have the same question (0)
  • Verified answer
    lardo5150 Profile Picture
    Microsoft Employee on at

    I was able to resolve this by changing the variable name.

    So dumb.

  • marpio Profile Picture
    on at

    Thanks for the workaround. Yet, I am expecting some more less magic explanation from MS

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard