cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Why are Variable Colors in Function Bar Different?

Hello,

I've seen this a few times now:
- What do the different Variable colors represent in the Function Bar?

In this example you can see two colors, blue and green. I've also seen black as a color (usually when there is an issue with the Variable)

image.png

Why?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Why are Variable Colors in Function Bar Different?

There are two types of variables in PowerApps: context variables (defined by the UpdateContext function, which are only visible in the screen on which they are defined) and global variables (defined by the Set function, which are visible on all screens in the app). Collections can be seen as another type of variable as well, which have a global scope.

The colors in the function bar reflect the types of the variables; in your case varPartialForm is likely a global variable, while varCancelPopup is probably a context variable.

The example below shows an example of the different coloring:

Set(gVar1, true); Set(gVar2, false); Set(gVar3, true);
UpdateContext({cVar1: true, cVar2: false, cVar3: true});
ClearCollect(
    coll,
    And(gVar1, gVar2),
    And(cVar1, cVar2),
    And(gVar3, cVar3))

It would be shown in the formula bar as:

ForumPost001.PNG

Hope this helps!

View solution in original post

1 REPLY 1
Highlighted
Power Apps
Power Apps

Re: Why are Variable Colors in Function Bar Different?

There are two types of variables in PowerApps: context variables (defined by the UpdateContext function, which are only visible in the screen on which they are defined) and global variables (defined by the Set function, which are visible on all screens in the app). Collections can be seen as another type of variable as well, which have a global scope.

The colors in the function bar reflect the types of the variables; in your case varPartialForm is likely a global variable, while varCancelPopup is probably a context variable.

The example below shows an example of the different coloring:

Set(gVar1, true); Set(gVar2, false); Set(gVar3, true);
UpdateContext({cVar1: true, cVar2: false, cVar3: true});
ClearCollect(
    coll,
    And(gVar1, gVar2),
    And(cVar1, cVar2),
    And(gVar3, cVar3))

It would be shown in the formula bar as:

ForumPost001.PNG

Hope this helps!

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (13,607)