cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vtom1994
Regular Visitor

Delete list items from Sharepoint after they have been submitted in a form

Hi there,

 

I'm trying to figure out how to delete list entries from a sharepoint list once a form containing those entries has been submitted in Powerapps.

 

In my current set up, the list entries are selected in a combobox and the submit button starts a patch function to populate a different sharepoint list.

 

Please see code below:

 

 

Set(
    Success,
    Patch(
        'Table Booking',
        Defaults('Table Booking'),
        {
            Title: txtUser.Text,
            Location: ddLocation.Selected.Result,
            GuestNames: Concat(
                cbTableGuests.SelectedItems,
                Name & "; "
            ),
            Table_x0020_Guests: Concat(
                cbTableGuests.SelectedItems,
                Email & "; "
            )
        }
    );
);
    SubmitForm(Form6);
    If(
        !IsBlank(Success),
        Notify(
            "Guests submitted!",
            NotificationType.Success           
        )
    
);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

I figured it out in the end!

It turned out to be pretty simple:

    Remove(
        Unassigned,
        cbTableGuests.SelectedItems,
        All
    );

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@vtom1994 

I am not entirely clear on what you want to delete.  

You are showing a patch and a submit form.  I assume they are to two different datasources.  

Can you explain what it is that you want to delete?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
RTW
Advocate III
Advocate III

@vtom1994  - It sounds like this is your workflow.

1. Select one or more items from SP List 1

2. Create a new entry on SP list 2 with a list of the users selected in Step 2

3. Remove users from list 1

 

I think what you would have to do is have it as an intermediary step. What I would do is something like this

 

ClearCollect(
	ToRemove,
	cbTableGuests.SelectedItems
	);
RemoveIf(TableGuests, ID in ToRemove.ID)

I figured it out in the end!

It turned out to be pretty simple:

    Remove(
        Unassigned,
        cbTableGuests.SelectedItems,
        All
    );

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,933)