cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Removing post from gallery wit multiple datasources


In my Gallery i can use Swicth do sort out my database to pick data from
SortByColumns(Filter(Switch(ddSkolvaljaren.SelectedText.Value ;
"YG A";YG2001AH;
"YG B";YG2002AH;
"YG C";YG2003AH;
"YG D";YG2004AH;
"YG E";YG2012AH ); StartsWith(Fullname_pedagog; TextSearchBox1_1.Text)); "Created"; If(SortDescending1; Descending; Ascending))
 
And  i have an removing post icon and i been trying to do the same there but it dosent work out
This works Remove(YG2001AH;ThisItem) so i have tor use the hard code . I trying to use like this But not working
pict1.PNG
 
 
 
Remove(Switch(ddSkolvaljaren.SelectedText.Value ;
"YG A";YG2001AH;
"YG B";YG2002AH;
"YG C";YG2003AH;
"YG D";YG2004AH;
"YG E";YG2012AH );ThisItem)
There is no complian on the code but after test it the red dot , hopefully i am near the solution any tips 
pict2.PNG
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@dalacarelia_196

PowerApps will not let you write a SWITCH statement that way because ThisItem has the potential to be different for each datasource.  Instead, you must do it the longer way...

 

Switch(
  ddSkolvaljaren.SelectedText.Value ;
  "YG A"; Remove(YG2001AH; ThisItem);
  "YG B"; Remove(YG2002AH; ThisItem);
  "YG C"; Remove(YG2003AH; ThisItem);
  "YG D"; Remove(YG2004AH; ThisItem);
  "YG E"; Remove(YG2012AH; ThisItem)
)

 

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

2 REPLIES 2
Super User III
Super User III

@dalacarelia_196

PowerApps will not let you write a SWITCH statement that way because ThisItem has the potential to be different for each datasource.  Instead, you must do it the longer way...

 

Switch(
  ddSkolvaljaren.SelectedText.Value ;
  "YG A"; Remove(YG2001AH; ThisItem);
  "YG B"; Remove(YG2002AH; ThisItem);
  "YG C"; Remove(YG2003AH; ThisItem);
  "YG D"; Remove(YG2004AH; ThisItem);
  "YG E"; Remove(YG2012AH; ThisItem)
)

 

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

Thank you this is om nice it works .

Perfect solution. 

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