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 / Date data type removal...
Power Apps
Unanswered

Date data type removal from the gallery

(1) ShareShare
ReportReport
Posted on by 11
Hi,
 
The purpose of this code is to remove a client and its start date from the table (I am connected to the SQL server).
 
There is an error with the SelectedDate data type: "Incompatible type. The collection can't contain values of this type." I've tried to cast this Date type to Text, but there is an error that the function expects here date type of data and not text.. It makes no sense.
 
Do you have any ideas of how to fix it?
 
Remove(
    'TABLE',
    Gallery_MY_GALLERY,
    {
    CLIENT_NAME: If(IsBlank(DataCard_Value_CLIENT_NAME.Text), Blank(), DataCard_Value_CLIENT_NAME.Text),
    START_DATE: If(IsBlank(DateValue.SelectedDate), Blank(), DateValue.SelectedDate)
    }
    );
Set(
    VarShowPopup,
    false
);
Navigate('HOME SCREEN'); Notify("Record deleted successfully", NotificationType.Success)
 
CLIENT_NAME is text input card type.
START_DATE is a date picker card type.
Categories:
I have the same question (0)
  • abc 123 Profile Picture
    789 Moderator on at
    The Remove() function removes (deletes) a row from a collection or list, not reset individual columns. RemoveIf, too.
     
    If you want to update the columns, then use the Update or UpdateIf function.
     
    Use the IfError() function to trap for errors.
     
    UpdateContext({strErrMsg: "None"});
    IfError(
      [Try to do something],
      UpdateContext({strErrMsg: FirstError.Message})
    );
    If(strErrMsg = "None" ,
      Notify("Something happened correctly, for once.");
      Navigate(scrnAnotherScreen)
      ,
      Notify("Something didn't happen correctly, again. Error: " & strErrMsg)
    )
     
  • AA-13081012-0 Profile Picture
    11 on at
    @abc 123 thanks for the answer. I used the Remove function before for other tables with text input only fields - it worked, the records were deleted immediately. I need to do the same for this table - I need to remove a client and its starting date from the table, but the issue is Date data type. Can you please help with this?
  • timl Profile Picture
    37,248 Super User 2026 Season 1 on at
    Can you clarify what DataCard_Value_CLIENT_NAME and DateValue are? Are these both controls on a Form control?
     
    If you want to remove all records where Client_Name matches the value in DataCard_Value_CLIENT_NAME and START_DATE matches the value in the DateValue picker, the syntax you would use is this:
     
    RemoveIf(
        'TABLE',
        CLIENT_NAME = DataCard_Value_CLIENT_NAME.Text &&
        START_DATE DateValue.SelectedDate
        )
     
  • abc 123 Profile Picture
    789 Moderator on at
    Wheneven I use the Remove, (I actually use RemoveIf()), I base it on the ID or something else unique.
     
    RemoveIf(ListName, ID=intIDtoRemove);
     
    I don't understand why you need to remove individual columns when you want to delete the entire item. Just delete the item and be done with it.
     
     
  • AA-13081012-0 Profile Picture
    11 on at
    @timl it worked!! thank you so much

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard