Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • AA-13081012-0 Profile Picture
    11 on at
    Date data type removal from the gallery
    @timl it worked!! thank you so much
  • abc 123 Profile Picture
    784 Super User 2025 Season 1 on at
    Date data type removal from the gallery
    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.
     
     
  • timl Profile Picture
    34,939 Super User 2025 Season 1 on at
    Date data type removal from the gallery
    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
        )
     
  • AA-13081012-0 Profile Picture
    11 on at
    Date data type removal from the gallery
    @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?
  • abc 123 Profile Picture
    784 Super User 2025 Season 1 on at
    Date data type removal from the gallery
    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)
    )
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard