cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Convert a String into a Num

I'm new into this.

I have the following formula on a Color property of a Label:

<If(Price.Text>= 1000, Red , Gray)>

<Price.Text> returns a String, so logically it doesn't evaluate.

Obvious questions is, how to convert that into a Number.

I tried <Price.Value> but i believe it doesn't work with labels.

 

Many thanks.

28 REPLIES 28
Anonymous
Not applicable

Ok got it. Now I need to understand it... I got a bit confused about what happened.

example_05.PNG

Anonymous
Not applicable

Why is that on the Color Property I need to refer to the Price without <ThisItem>:

If(     Price>1000; Red;Gray)

and on the text property I need to use ThisItem:

ThisItem.Price & " €"

 

Price should mean the same in both places, since Text and Color are both properties of the same label...

 

 

 

If(Value(ItemPriceLable.Text) > 256,RGBA(150, 256, 150, 1),RGBA(256, 150, 150, 1))

example_14.PNG

 

Anonymous
Not applicable

Sorry, but I'm not getting there, just with the images...

are you storing your prices in a "List" or "Excel".

Anonymous
Not applicable

Exel

I'm guesing you

First setup your spreadsheet with a table (I recommend naming your Table)

example_17.PNG

after making your spreadsheet load it and the table into powerapps

example_15.PNG

make a gallery and add price label to gallery and price to label then add the script I mentioned earlier to the label.

example_16.PNG

Anonymous
Not applicable

That has been done since the beginning(my data is formatted as a table, and is named, that's not the issue here). I was hopping you could explain your latest PrtSc's. I still don't see what you mean with them. Although I must thank you for all the work you're having to answer me.

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (93,058)