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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Removing record from c...
Power Apps
Unanswered

Removing record from changing data source (specified data source cannot be used with this function)

(0) ShareShare
ReportReport
Posted on by
Hello community,
 
I am having some problems removing a record from a data source, I have the following code on a button:
 
ForAll(recordGrid,Remove(Switch(OptionVar,"OPT1",OPT1_DS,"OPT2",OPT2_DS,"OPT3",OPT3_DS),ThisRecord));
 
The data source depends on the switch, and if the user selects a record and then click the button, I want that record to be removed, but I am getting the following error: specified data source cannot be used with this function
 
Thanks in advance for the help
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    Hi @JA-19121540-0​​​​​​​
    You cannot refer to data sources dynamically - you will need to "hard code" all of that. The other issue is that ThisRecord can only refer to one record, which will only be of one of the data sources.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard