cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jbrit2020
Continued Contributor
Continued Contributor

Numeric Values in Dropdownbox In Component

So, I have a component with 5 dropdown boxes, and I need them to have numeric values stored as integer and not text as I will have to apply some maths to the selection. In order to do this, I've set a global variable with the following:

 

Set(CatRisks,
Table(
{Cat:1},
{Cat:2},
{Cat:3},
{Cat:4},
{Cat:5}
)
);

 

This works great as long as the dropdown boxes are outside of the component. Inside of the component I can't reference APP variables. Which other way do I have to define numeric values on the dropdown boxes inside the component?

 

Regards

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@jbrit2020 

Create a Property on your Component as a Table property (let's call it ListOfNumbers)

Set the dropdown items property in the Component to : yourComponentName.ListOfNumber

 

Then from your app, set the property yourInsertedComponentName.ListOfNumbers to CatRisks

 

I hope this is helpful for you.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
gabibalaban
Dual Super User
Dual Super User

Hi @jbrit2020 ,

Did you try to use the Reset() property of the component to set this global variable inside component ? 

And on the app use on OnVisible property of the screen Reset(component). Be sure not to use the same variable in other places of the app, because it is still a global variable.

 

Hope it helps ! 

RandyHayes
Super User
Super User

@jbrit2020 

Create a Property on your Component as a Table property (let's call it ListOfNumbers)

Set the dropdown items property in the Component to : yourComponentName.ListOfNumber

 

Then from your app, set the property yourInsertedComponentName.ListOfNumbers to CatRisks

 

I hope this is helpful for you.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
jbrit2020
Continued Contributor
Continued Contributor

Thanks! That solved the issue

Helpful resources

Announcements
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.

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 (3,062)