cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

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
CarlosFigueira
Power Apps
Power Apps

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
CarlosFigueira
Power Apps
Power Apps

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (89,940)