cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dalacarelia_196
Helper IV
Helper IV

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
mdevaney
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
mdevaney
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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,874)