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 / Remove Details from my...
Power Apps
Answered

Remove Details from my Expense Details

(0) ShareShare
ReportReport
Posted on by 60

I have create 2 List in share point. One is Called Local Purchase order and next one ExpenseDetails.

 

I have create a delete option for LPO in power apps and i want when i delete 1 LPO to delete also details from ExpenseDetails how is this possible?

 

i use the below:

Remove('Local Purchase Order - List', MasterGallery.Selected);If (IsEmpty(Errors('Local Purchase Order - List', MasterGallery.Selected));, Back()); UpdateContext({showdeletelpo:false}) ;Notify( "LPO Has been Deleted", NotificationType.Success, 0 ); Navigate(ViewScreen)

Categories:
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @DemosCY ,

    You have not mentioned the linking field between these lists - I have used the ID of the primary list and below - change to whatever fields you are linking them on

    UpdateContext({vRefID:MasterGallery.Selected.ID})
    RemoveIf(
     'Local Purchase Order - List', 
     ID=MasterGallery.Selected.ID
    );
    If(
     !IsBlank(
     Lookup(
     ExpenseDetails,
     YourRef=vRefID,
     vRefID
     )
     ),
     RemoveIf(
     ExpenseDetails,
     YourRef=vRefID
     )
    )

    I have not added the rest of your code.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • CU07011146-0 Profile Picture
    60 on at

    Hi Warren

     

    thank you for your response, linking field is the ID

     

    i dont know if i understand it correctly:

     

    Capture.PNG

    Capture.PNG
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    @DemosCY ,

    Firstly, can you please post code as Text also - very had to transcribe an image.

    Secondly, you need to use the linking field in the secondary list, not ID on the second list.

  • CU07011146-0 Profile Picture
    60 on at

    Hi Warren

     

    1 List should be LPO and 2nd Expense Details

     

    it should work against ID and MasterID

     

    sorry but i am kind new in powerapps 🙂

     

    UpdateContext({vRefID:MasterGallery.Selected.ID});RemoveIf('Local Purchase Order - List',ID=MasterGallery.Selected.ID);If(!IsBlank(LookUp(ExpenseDetails,MasterID=ID,ID)),RemoveIf(ExpenseDetails,MasterID=ID));UpdateContext({showdeletelpo:false});Notify( "LPO Has been Deleted", NotificationType.Success, 0 ); Navigate(ViewScreen)

  • Verified answer
    WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @DemosCY ,

    Using the field names you have supplied, try this

    UpdateContext(
     {
     vRefID:
     MasterGallery.Selected.ID
     }
    );
    RemoveIf(
     'Local Purchase Order - List',
     ID=vRefID
    );
    If(
     !IsBlank(
     LookUp(
     ExpenseDetails,
     MasterID=vRefID,
     MasterID
     )
     ),
     RemoveIf(
     ExpenseDetails,
     MasterID=vRefID
     )
    );
    UpdateContext({showdeletelpo:false});
    Notify("LPO Has been Deleted", NotificationType.Success, 0 ); 
    Navigate(ViewScreen)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • CU07011146-0 Profile Picture
    60 on at

    that works

     

    thank you very much appreciate the help!

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

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard