cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Set DropDown value based on number in another field

Hi,

 

I have a PowerApps app based from a SharePoint List and in it I have one field (Outcome) based on a dropdown list, what I am trying to do is:

If the user enters the number 3 in another field of type number, i want to set the Outcome dropdown value to "Declined" but otherwise leave the Outcome value to whatever the user chooses from the dropdown.

I've read so many threads now online but none work as I can't seem to get Powerapps to access the number in the second datacard.

I have checked that the second field is definitely of type Number, but the only parameter i get to access the data in the datacard is DataCardValue177.Text and that fails as the value is not of type text

7 REPLIES 7
Super User III
Super User III

Hi @Jonmoon74 ,

You did not provide your filter code, but the test you need is

Value(DataCardValue177.Text)=3

or

DataCardValue177.Text="3"

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thanks for the reply @WarrenBelz, but when i try and use that in an If statement on the Default property of the DropDown field, i get an error that the formula uses scope that is currently unsupported and the formula cannot be evaluated

Resolver I
Resolver I

Hi @Jonmoon74 ,

 

On onchange property of text input save the status in updatecontext.

 

if it is equal to 3 set to active, in your case it would be declined.

 

UpdateContext({StatusValue: If(Value(TextInput2.Text) = 3, NewStatusReason.'Active ')})

 

Then in Default property of dropdown set updatecontext variable "StatusValue".

 

 

Regards,

Prakash

Hi Prakash,

 

I'm not following how NewStatusReason.'Active ' would set Declined from the dropdown list, am i missing something?

Resolver I
Resolver I

Hi @Jonmoon74 ,

 

It is just an example, newstatus reason is the list of values available in my dropdown, active is the value which will get set based on condition.

 

 

Regards,

Prakash

@Jonmoon74 ,

One of those two has to be valid if you have a number in there.

If you want me to help you here, please supply the code you are using in Text.

Regular Visitor

Hi @A-Warr & @Prakash4691 ,

 

Thank you both for trying to help, but none of the above seems to work, there must be something really simple I am missing, but since the setting of Declined in the Outcome field is needed to trigger a power automate flow, I have for now just added an extra clause to the automate flow to also pick up the value of 3 in this field and mark as Declined outside the app. - not as elegant as doing it inside the app but does the job while i root around for the bug that is stopping things

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,146)