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

Results from 2 dropdowns to populate value in text box

Hello,

 

I have a datacard with 3 values and a dropdown with 4 values. What I would like to do is to populate a textbox with a numeric value based on the selections in datacard and dropdown. Here is some examples

 

datacard=abc and dropdown=opq then textbox=5

datacard=abc and dropdown=rst then textbox=10

datacard=abc and dropdown=uvw then textbox=15

datacard =abc and dropdown=xyz then textbox=20

 

datacard=def and dropdown=opq then textbox=50

datacard=def and dropdown=rst then textbox=55

datacard=def and dropdown=uvw then textbox=60

datacard=def and dropdown=xyz then texbox=65

 

datacard=ghi then no matter what dropdown equals then textbox=0

 

I thought this would have worked

If(Value(DataCardValue8.Selected.Value) = abc And Value(DropDown1.Selected.Value) = opq, "5")

But it doesn't work so I didn't try to add the others.

Any suggestions?

 

1 ACCEPTED SOLUTION

Accepted Solutions

I solved it by using the following

If(
DataCardValue8.Selected.Value="Deviation",
0,
DataCardValue8.Selected.Value="SNCR",
Switch(Dropdown1.Selected.Value,
"None",0,
"Replace",150,
"Scrap/Re-Order",0,
"Use As-Is",150,
"Re-Work In-House",0,
"Supplier Re-Work",0),
DataCardValue8.Selected.Value="Hold Tag",
Switch(Dropdown1.Selected.Value,
"None",0,
"Replace",150,
"Scrap/Re-Order",680,
"Use As-Is",0,
"Re-Work In-House",330,
"Supplier Re-Work",530)
)

View solution in original post

6 REPLIES 6
JamesYumnam
Resolver III
Resolver III

Hi @prepglobal please udpate the If condition in the Defaultas below.

I tried the following sample data I had and it works:

1. Two dropdown datacards and 1 text box

JamesYumnam_4-1625342837703.png

 

 

2. Set textbox Default to 

If(DataCardValue30.Selected.Value = 'Status (MyTable1s)'.Active && DataCardValue31.Selected.Value = 'Status Reason (MyTable1s)'.Inactive,"15")

where DataCardValue30 is datacard dropdown1   and  DataCardValue31 is datacard dropdown2

MyTable1s is the datasource.

 

Output1

JamesYumnam_2-1625342664620.png

Output2

JamesYumnam_5-1625342866885.png

 

Hope this helps you.

JamesYumnam
Resolver III
Resolver III

@prepglobal i hope this will give you a hint now, using If and Switch:

 

JamesYumnam_2-1625343941470.png

 

 

 

 

 

prepglobal
Frequent Visitor

I am missing something, I am guessing because my second selection field is not a DataCard its a DropDown.

Here is the results from the first one

prepglobal_1-1625385124866.png

And the second one

prepglobal_0-1625385032020.png

 

 

@prepglobal 

Probably syntax error: you have used two If conditions and I can see a semi-colon (;) missing between them. 

(In my case, I have used nested If conditions.)

I solved it by using the following

If(
DataCardValue8.Selected.Value="Deviation",
0,
DataCardValue8.Selected.Value="SNCR",
Switch(Dropdown1.Selected.Value,
"None",0,
"Replace",150,
"Scrap/Re-Order",0,
"Use As-Is",150,
"Re-Work In-House",0,
"Supplier Re-Work",0),
DataCardValue8.Selected.Value="Hold Tag",
Switch(Dropdown1.Selected.Value,
"None",0,
"Replace",150,
"Scrap/Re-Order",680,
"Use As-Is",0,
"Re-Work In-House",330,
"Supplier Re-Work",530)
)

JamesYumnam
Resolver III
Resolver III

@prepglobal  awesome! Hope, you found my answers helpful on how to read the values from those datacard and the dropdown.. 👍

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (3,215)