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
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (28,756)