cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CamiloHU
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,
ThisItem.PesoPriorizacion=0.9,gblOrden=2,
ThisItem.PesoPriorizacion=0.98,gblOrden=3)

"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

CamiloHU_0-1639584337976.png

 




7 REPLIES 7
Pstork1
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),
if(self.selected.PesoPriorizacion=0.98,Set(gblOrden,3)))

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(
ThisItem.PesoPriorizacion=0.9,2,if(
ThisItem.PesoPriorizacion=0.98,3)))


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

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
rampprakash
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),
ThisItem.PesoPriorizacion=0.9,Set(gblOrden,2),
ThisItem.PesoPriorizacion=0.98,Set(gblOrden,3))

 

Try above code 🙂

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

CamiloHU
Frequent Visitor

@rampprakash 
That didn't work, I got the following errors:
CamiloHU_1-1639594853768.png

CamiloHU_0-1639594835637.png

 

CamiloHU
Frequent Visitor

@Pstork1 

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

CamiloHU_2-1639595039642.png

 

is this on the onselect property?



Signature:


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:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

Hello @CamiloHU,

 

Can you please try this code in Label

 

If(ThisItem.PesoPriorizacion =1.0, 1,
ThisItem.PesoPriorizacion=0.9,2,
ThisItem.PesoPriorizacion=0.98,3)

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

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.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (1,846)