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 / Removing a row from 2 ...
Power Apps
Answered

Removing a row from 2 databases

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello!

I am using a formula to delete a ticket from my database and then also delete an image from another database. The formula I am using for this: 

 

Remove([@'Foto''s Manco App'], LookUp('Foto''s Manco App',Title = DataCardValue12.Text & " " & DataCardValue24.Text));

Remove(
 [@'Manco-Informatie'],
 OverzichtGallery.Selected
);

If (
 IsEmpty(
 Errors(
 [@'Manco-Informatie'],
 OverzichtGallery.Selected
 )
 ),
 Back()
) && UpdateContext({Popup: false})

 

Whenever I use the code like this, only the second remove works. When I remove the bottom part and only put the top remove part, the top code works. 

What am I doing wrong here?

 

 

 

 

 

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I don't know why this would happen. It is very strange. However, I did notice an improvement in the code, which might work.

    Remove([@'Foto''s Manco App'], LookUp('Foto''s Manco App',Title = DataCardValue12.Text & " " & DataCardValue24.Text));
    
    Remove(
     [@'Manco-Informatie'],
     OverzichtGallery.Selected
    );
    
    If (
     IsEmpty(
     Errors(
     [@'Manco-Informatie'],
     OverzichtGallery.Selected
     )
     ),
     Concurrent(Back(), UpdateContext({Popup: false}))
    ); 
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you mean that the remove function will only work one?

    That's a little strange...

    Could you tell me

    1)where do you put this formula?

    2)the relationship between the form and OverzichtGallery.Selected

    3)the screenshoot of your app?

    Please notice one thing:
    if the form is updated, the data in the form will become invalid. In your issue, DataCardValue12.Text and DataCardValue24.Text will become invalid after you submit the form. So if this formula is related to the form's updating, you need to firstly save DataCardValue12.Text and DataCardValue24.Text  as variables before update the form. Then after you update the form, you could use these two variables in your other formulas.

     

    Since I do not know your app's logic very clearly, I could not give you detailed solution.

    Maybe you could try Concurrent function, which will evaluate multiple formulas at the same time.

     

    Concurrent(
    Remove([@'Foto''s Manco App'], LookUp('Foto''s Manco App',Title = DataCardValue12.Text & " " & DataCardValue24.Text)),
    Remove(
     [@'Manco-Informatie'],
     OverzichtGallery.Selected
    )
    );
    
    If (
     IsEmpty(
     Errors(
     [@'Manco-Informatie'],
     OverzichtGallery.Selected
     )
     ),
     Back()
    ) && UpdateContext({Popup: false})

     

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That has done it, thank you! @v-yutliu-msft 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-yutliu-msft  When I use this formula and have multiple rows, it doesn't work. I can have multiple rows with the same name, how can I make it remove every row for this formula:

    Remove([@'Foto''s Manco App'], LookUp('Foto''s Manco App',Title = DataCardValue12.Text & " " & DataCardValue24.Text)),



    Full code:

    Concurrent(
    Remove([@'Foto''s Manco App'], LookUp('Foto''s Manco App',Title = DataCardValue12.Text & " " & DataCardValue24.Text)),
    Remove(
     [@'Manco-Informatie'],
     OverzichtGallery.Selected
    )
    );
    
    If (
     IsEmpty(
     Errors(
     [@'Manco-Informatie'],
     OverzichtGallery.Selected
     )
     ),
     Back()
    ) && UpdateContext({Popup: false})



     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    LookUp returns the first matching row only. You can use RemoveIf to remove all matching rows. 

    RemoveIf([@'Foto''s Manco App'], Title = DataCardValue12.Text & " " & DataCardValue24.Text)

     

    You can also use filter which will return all matching rows. 

    Remove([@'Foto''s Manco App'], Filter([@'Foto''s Manco App'], Title = DataCardValue12.Text & " " & DataCardValue24.Text))

     

    Documentation:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-remove-removeif

     

    Best,
    Zabi
    Mark this post as a solution, or kudo it if you found it be helpful. You can choose more than one answers as solutions, including your own answer. 🙂

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    First code didn't work, second one did. Thank you @Anonymous 

     

     

     

     

     

     

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard