Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

this formula uses scope which is not presently supported for evaluation, data type boolean

Hi, I am trying to assign a value to a global variable, On a txtlabel.text The formula is as follows: 
If(ThisItem.PesoPriorizacion =1.0, gblOrden=1,

"Pesopriorization" is a percentage type value and , I am displaying this formula in a gallery, which contains multiple values. However, the formula always gives me "false" as a result. What is the error, how can I fix it?

Thank you very much



Dual Super User
Dual Super User

You can't set a global variable inside an individual record in a gallery.  You also can't just assign a value to a global variable without using the Set() function.  What you probably want is to put something like this in the OnSelect of the gallery itself.  That will set the veariable when you select a record in the gallery.

if(self.selected.PesoPriorizacion =1.0, Set(gblOrden,1),
if(self.selected.PesoPriorizacion=0.9, Set(gblOrden,2),

The question is what do you want to display in the label inside the gallery?  Are you trying to display what you are putting in glbOrden?  YOu don't use a variable for that.  If that is what you want this is the formula for the label.

If(ThisItem.PesoPriorizacion =1.0, 1,if(

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Super User
Super User

Hello @CamiloHU,


You need to set the variable, if you use = then its like true or false statement


If(ThisItem.PesoPriorizacion =1.0, Set(gblOrden,1),


Try above code 🙂


Please mark as Answer if it is helpful and provide Kudos

Subscribe :
Blog :

Frequent Visitor

That didn't work, I got the following errors:



Frequent Visitor


I tried it and the label does not show any value and the warning changes to data type: number.



is this on the onselect property?


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

Hello @CamiloHU,


Can you please try this code in Label


If(ThisItem.PesoPriorizacion =1.0, 1,


Please mark as Answer if it is helpful and provide Kudos

Subscribe :
Blog :

Normally the label will automatically cast the number to a string, but if it doesn't you can surround it with a Text() function to cast it or change the numbers like 1 to "1" in the formula.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,179)