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 / Unable to use a named ...
Power Apps
Suggested Answer

Unable to use a named function refering to a datasource with the remove function

(0) ShareShare
ReportReport
Posted on by 2
I'm unable to use a named function (defined in App.Formulas) returning a datasource with the remove function. It says the first parameter must be a collection.
 
App.Formulas:
nf_DataSourceInvoices = Invoices
ButtonDelete.OnSelect:
Remove(nf_DataSourceInvoices;Lookup(nf_DataSourceInvoices;ID=DataTableInvoices.Selected.ID))
 
If I use the DataSource directly, it will work
Remove(Invoices;Lookup(Invoices;ID=DataTableInvoices.Selected.ID))
 
my named function works in other functions like Lookup, Patch, etc.

Any idea/advice ?
  • Suggested answer
    Inogic Profile Picture
    1,297 Moderator on at
    Hi,
     
    The issue arises because the Remove function in Power Apps explicitly requires the first parameter to be a direct reference to a data source or a collection, not the result of a named function. While named functions like nf_DataSourceInvoices can be used with read operations such as Lookup or Patch, they are treated as calculated results, not direct references.

    To resolve this, use the data source directly in the Remove function
    e.g., Remove(Invoices, Lookup(Invoices, ID = DataTableInvoices.Selected.ID))
    or
    assign the result of the named function to a collection using ClearCollect
    e.g., ClearCollect(colInvoices, nf_DataSourceInvoices) and then use the collection in the Remove function.
     
    Hope this helps.
     

    Thanks!

    Inogic Professional Services: Power Platform/Dynamics 365 CRM
    An expert technical extension for your techno-functional business needs
    Drop an email at crm@inogic.com 
    Service: https://www.inogic.com/services/ 
    Tips and Tricks: https://www.inogic.com/blog/ 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard