cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
franky0711
Helper III
Helper III

Toggle should switch "Item" of Datacard

Hi guys,

 

I have a toggle (Yes/No)

and I have a Datacard Value 12 which looks in my "List_Dummy".

In this List I have many choices (see in Pic 2)

One of these is "Sonstiges" in Column "Projekt"

 

My aim is:

 

If i change toogle to YES, my Datacard Value 12 should go to "Sonstiges".

I need that because in case of toogling to YES my user should not waste his time searching for entry "Sonstiges".

 

At the moment I have set in my Datacard Value 12

Items = Choices([@'List_Dummy'].Projekt)

 

I tried an If-Statement without success.

 

Thank you so much 🙂

 

My Aim with toggleMy Aim with toggleDummy ListDummy List

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@franky0711 

Start by putting this code in the OnVisible property of your screen

 

Set(projectReset, false);
Set(projectDefault, {Value: ""});
Set(projectDefault, Blank());

 

Then this code in the OnCheck property of your toggle

 

Set(projectDefault, {Value: "Sonstiges"})
Set(projectReset, false); Set(projectReset, true); 

 

This code goes in the Reset property of the dropdown

 

projectReset

 

Finally, use this code in the DefaultSelectedItems property of the dropdown.

 

If(IsBlank(projectDefault), ThisItem.Projekt, projectDefault) 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@franky0711 

Start by putting this code in the OnVisible property of your screen

 

Set(projectReset, false);
Set(projectDefault, {Value: ""});
Set(projectDefault, Blank());

 

Then this code in the OnCheck property of your toggle

 

Set(projectDefault, {Value: "Sonstiges"})
Set(projectReset, false); Set(projectReset, true); 

 

This code goes in the Reset property of the dropdown

 

projectReset

 

Finally, use this code in the DefaultSelectedItems property of the dropdown.

 

If(IsBlank(projectDefault), ThisItem.Projekt, projectDefault) 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

@mdevaney  Thanks for helping me 🙂

 

I understand what you try to do. 

I think there is not so much missing for me to getting it to work 🙂

 

My last error here: 

Btw: My dropdown is a Combo-field. I think this is both ok...?!

 

 

Here my error on "Default" on my Combo-Box:

Searching for a record instead of Text 😞

 

4.JPG

 

 

@franky0711 

Comboboxes and dropdowns behave differently so I made some changes to my code above.

@mdevaney  

 

Yeah Working !!!

 

But I wrote your last formula into DefaultselectedItems instead of Default 🙂

 

Defaultselecteditems = If(IsBlank(projectDefault); ThisItem.Projekt;projectDefault)

 

 

Thank you so much!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,352)