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

Zwei abhängige Dropdown miteinander Vergleichen

Hallo Leute,

 

Ich bin neu in dem Thema Power Apps und komme an einem Punkt nicht weiter.

 

Ich habe zwei Dropdown in denen man etwas auswählen kann, dazu zu jedem noch mal ein Dropdown das in Abhängigkeit

zu dem daneben steht und die Nummer zu dem Wert daneben anzeigt.

CherryKing_0-1613717289703.png

Das Grün umrandete ist später sichtbar.

Das Rot umrandete ist nachher ausgeblendet und nur zum Vergleichen gedacht.

 

Nun möchte ich die zwei Zahlen in den Roten Dropdown vergleichen.

Ich hätte gerne, dass wenn die obere Zahl größer ist eine 1 steht und umgekehrt eine 2.

In was für einem Feld die zwei Zahlen dann stehen ist mir egal. Ich muss sie nur nachher wieder für eine

Formel, die schon funktioniert hat, wiederverwenden können.

 

Ich habe es mit einem Beschriftungsfeld probiert und diese Formel genommen. 

If(Dropdown_1 > Dropdown_2; 1)

 

Leider funktioniert es nicht. Auch mit .Value dahinter geht es nicht.

Die Formel erwartet immer eine Zahl.

In der Tabelle die ich als Element für die Dropdowns genommen habe, ist die Spalte als Zahl Formatiert.

 

Ich glaube ich muss die zwei Dropdowns mit den zahlen irgendwie als Zahl formatieren.

Leider habe ich keine Ahnung wie und ob das überhaupt funktioniert.

 

Hätte Jemand vielleicht eine Lösung für mein Problem?

 

Danke im Vorhinein

CherryKing

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @CherryKing ,

 

I think I know where the problem is.

Please use 'Nummer' instead of 'Number'.

If(Value(Dropdown1.Selected.Nummer)>Value(Dropdown2.Selected.Nummer),1)

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

12 REPLIES 12
v-xiaochen-msft
Community Support
Community Support

Hi @CherryKing ,

 

According to your description, I've made a test for your reference:

1\ Add a dropdown control 'Dropdown1' and set its Items property to:

["1","2","3"]

 

2\ Add a dropdown control 'Dropdown2' and set its Items property to:

["1","2","3"]

 

3\ Add a label control and set its Text property to:

If(Value( Dropdown1.Selected.Value)> Value(Dropdown2.Selected.Value),1)

 

4\ The result is as follows:

2.PNG3.PNG

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

CherryKing
Regular Visitor

Hi @v-xiaochen-msft

 

Thanks for your answer.

 

I think there is a language problem?

 

I have the top two dropdown dependent on each other.

The bottom two exactly the same. If I change something on the left side, the number on the right changes automatically.

 

So on my Item property there is the code for the dependence?

 

Where should I enter ["1", "2", "3"] ?

 

Best Regards,

CherryKing

v-xiaochen-msft
Community Support
Community Support

Hi @CherryKing ,

 

This is just an example.

You could try to use the formula directly:

If(Value( Dropdown1.Selected.Value)> Value(Dropdown2.Selected.Value),1)

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

CherryKing
Regular Visitor

Hi @v-xiaochen-msft ,

 

I tried.

I entered the formula and replaced "Dropdown1" and "Dropdown2" with my dropdowns.

I still have an error:

The "Value" function has invalid arguments.

 

Best Regards,
CherryKing

CherryKing
Regular Visitor

Really?

An answer that doesn't work and that's it?

 

Thank you @v-xiaochen-msft...

(Sarcasmus)

v-xiaochen-msft
Community Support
Community Support

Hi @CherryKing ,

 

Please provide the formulas for your four dropdown controls.

 

Best Regards,
Wearsky

CherryKing
Regular Visitor

Hi

 

Here are my formulas:

Übersicht.jpg

 

 

 

 

 

 

1.jpg2.jpg

3.jpg4.jpg

 

Best Regards

v-xiaochen-msft
Community Support
Community Support

Hi @CherryKing ,

 

According to your description, I've made a test for your reference:

1\ This is my hypothetical list ‘Stationen’. ‘Stationen’ is a Single line of text column. ‘Number’ is a number column.

v-xiaochen-msft_0-1613978645217.png

 

 

2\ Add a label control and set its Text property to:

If(Dropdown1.Selected.Number>Dropdown2.Selected.Number,1)

You alos could try this formula:

If(Value(Dropdown1.Selected.Number)>Value(Dropdown2.Selected.Number),1)

 

3\ The result is as follows:

AAA.gif

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

CherryKing
Regular Visitor

Hi

 

thanks for the answer, unfortunately it didn't work.

Screenshot 2021-02-22 085200.jpgScreenshot 2021-02-22 085315.jpg

Where did you enter the data on your first picture?

I imported an Excel and used it.

Screenshot 2021-02-22 085523.jpg

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,709)