cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crjohnson82
Level: Powered On

Delete two items at one time

I added a delete icon, and used the below formula on OnSelect.

 

Remove('Requests',MasterGallery.Selected);RemoveIf('Details', TextInput5 = ID_DataCard2)

 

- TextInput5 is a format is a number (copied to the list, when the item is created)

- ID_DataCard2 (the number that was automatically created.)

 

It's giving me the error:  "Incompatible type: We can't evaluate you formula because the values being compared in the formula aren't the same type."

 

I am trying to select an item in the MasterGallery, and when I click delete, delete items in the EditForm and DetailGallery, if the TextInput ID (DetailGallery) =  ID_DataCard2 (EditForm).  

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Delete two items at one time

Hi @crjohnson82 ,

Why do you want to use textinput5 and ID_datacard2?

You could use the fieldname of masterlist and detaillist to filter.

Try this forumla:

Remove('Requests',MasterGallery.Selected);RemoveIf('Details',MasterID=MasterGallery.Selected.MasterID)

Textinput5 is just a control inside gallery, using this to filter items will not work.

What's more, ID_datacard2 is a card name, using this will not represent the ID value.

You could also try:

Remove('Requests',MasterGallery.Selected);RemoveIf('Details',MasterID=ID_DataCard2.Update)

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Dual Super User
Dual Super User

Re: Delete two items at one time

Hi @crjohnson82 

 

Can you try to update your expression as:
 
Remove('Requests',MasterGallery.Selected);RemoveIf('Details', TextInput5.Text = ID_DataCard2.Text)
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
crjohnson82
Level: Powered On

Re: Delete two items at one time

@yashag2255  I was able to get it to delete a record, but its not funtioning as it should.

 

If I start from the bottom (Select item in MasterGallery) and delete it works fine . But if I selected any of the items besides the bottom it deletes all the records in Details form. 

 

So if it 5 items in the list.. I select #5 it works. If I select 1-4 it deletes all of the records in the Details form. 

 

 

Community Support Team
Community Support Team

Re: Delete two items at one time

Hi @crjohnson82 ,

Could you describe more clearly about the relationship of gallery and editform?

What is TextInput5 and ID_DataCard2?

I'm a little confused about "delete items in the EditForm and DetailGallery, if the TextInput ID (DetailGallery) =  ID_DataCard2 (EditForm)".

Is Textinput5 a control and ID_DataCard2 a specific text content?

If so, try this formula:

Remove('Requests',MasterGallery.Selected);RemoveIf('Details', TextInput5.Text = "ID_DataCard2")

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
crjohnson82
Level: Powered On

Re: Delete two items at one time

@v-yutliu-msft 

TextInput5 is a text input inside of the galley(DetailGallery) = Its the MasterID

ID_DataCard2 is the DataCardValue for the system generated ID # (EditForm)

 

So it when item seleted in MasterGalley, delete that Item and all detail items when ID=MasterID. 

 

Little Background.. 

 

On the Screen, I have:

A MasterGallery that is connected to an EditFrom and the EditForm is connected to the DetailGallery. The screen is configure to show a repeating table form. 

 

We way it works is when a user selects a item for the MasterGallery,  it shows the item in the MasterList(List1) and the all the Detailed Items assoicated with the item in the MasterList. (When item is created, the generated ID (In Master List) is copied to the Detail List (MasterID) column.

 

i.e... User Selected ID 12:  Output Shows ID I2 Master Item, and Details MasterID.12 Items. (It can be mulitiple items in the detailed list that are associated with Master ID 12).  

Community Support Team
Community Support Team

Re: Delete two items at one time

Hi @crjohnson82 ,

Why do you want to use textinput5 and ID_datacard2?

You could use the fieldname of masterlist and detaillist to filter.

Try this forumla:

Remove('Requests',MasterGallery.Selected);RemoveIf('Details',MasterID=MasterGallery.Selected.MasterID)

Textinput5 is just a control inside gallery, using this to filter items will not work.

What's more, ID_datacard2 is a card name, using this will not represent the ID value.

You could also try:

Remove('Requests',MasterGallery.Selected);RemoveIf('Details',MasterID=ID_DataCard2.Update)

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,998)