web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Removing post from gal...
Power Apps
Answered

Removing post from gallery wit multiple datasources

(0) ShareShare
ReportReport
Posted on by 648

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
 
 
Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @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."

  • dalacarelia_196 Profile Picture
    648 on at

    Thank you this is om nice it works .

    Perfect solution. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard