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

Remove after Patch

Hi there, 

I have an app in which it is possible to add/patch to a sharepoint list, the item/name added is depended on the user as it is synced with office365 users, meaning that the item patched is the email of the person using the App. 

Now the patch function works perfectly and without any flaws, the user checks of in a checkbox and the by pressing the button, the data is inserted to the linked SP list. However i now want to make a function that can remove what has been patched, i have tried below, but i does not work although it does not give me any flaws, it does not actually remove what has been patched, I was wondering if anyone in here would be able to help? 🙂 

 

 

If('Monday()'.Value = true;
Patch(Monday;Defaults(Monday);{Titel:User().Email}));;

Mandag check.PNG

 

 

f('Monday()_1'.Value = true;

Remove(Monday;Defaults(Monday);{Titel:User().Email}));;

Mandag check.PNG

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Filsdegandalf
Level: Powered On

Re: Remove after Patch

Ok i just did the test with the piece of code below and it's working. Strange ~~

 

If(Checkbox1.Value = true, Remove(ListeFiche,{ID:244}))

Do you have something on check / uncheck / select of your checkbox? can u try with a new checkbox in order to test? 

 

Regards,

View solution in original post

Community Support Team
Community Support Team

Re: Remove after Patch

Hi @TCH ,

The right syntax of Romove is:

Remove( DataSource, Record1 [, Record2, ... ] [, All ] )

So please modify your formula like this:

If('Monday()_1'.Value = true;
Remove(Monday;LookUp(Monday;Titel=User().Email)));;

Here's a doc about this function for your reference:

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

 

 

Best regards,

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

8 REPLIES 8
Filsdegandalf
Level: Powered On

Re: Remove after Patch

Hello @TCH 

 

Can you please try this :  

 

 

If('Monday()'.Value = true;
Set(gblItemPatched,Patch(Monday;Defaults(Monday);{Titel:User().Email})));; ( a Patch is returning the object created )

 

 

Remove(Monday;{ID: gblItemPatched.ID})

Regards,

TCH
Level: Powered On

Re: Remove after Patch

@Filsdegandalf 

This would seem like it would do the trick, however it still seems like it doesn't really "connect" with the list, I can see the app working away on the issue, however noting updates/repatches/removes in the SP list? Its a little strang. 

But thanks so much anyways 🙂 

- Tobi

Filsdegandalf
Level: Powered On

Re: Remove after Patch

You mean that you're displaying the list data in your app? and it's not refreshing after the update / remove ?

TCH
Level: Powered On

Re: Remove after Patch

@Filsdegandalf Oh no sorry!

I am not displaying the data in the app, the data is only displayed on a SP list. Also what i meant when I set that it still doesn't work, is that it work in the way that it removes the desired thing however, it does not do this based on a condition. 

Hope that makes more sense 🙂 
- Toias 

TCH
Level: Powered On

Re: Remove after Patch

@Filsdegandalf 

In the first part of the app the user is able to tick off monday or any other weekday and press order, with this formula: 

If('Mandag()'.Value = true;
Set(gblItemPatched;Patch(Mandag;Defaults(Mandag);{Titel:User().Email})));;

Later in the app, if they regret, they are able to cancel, with this formula: 

If('Mandag()_1'.Value = true;
Remove(Mandag;{ID: gblItemPatched.ID})

 

However the issue that i am having is that it does remove an item from the list, but it doesn't do it based on a condition, it does so regardless of whether a box has been ticked or not 🙂 

- Tobi

Highlighted
Filsdegandalf
Level: Powered On

Re: Remove after Patch

Ok i just did the test with the piece of code below and it's working. Strange ~~

 

If(Checkbox1.Value = true, Remove(ListeFiche,{ID:244}))

Do you have something on check / uncheck / select of your checkbox? can u try with a new checkbox in order to test? 

 

Regards,

View solution in original post

TCH
Level: Powered On

Re: Remove after Patch

@Filsdegandalf  Tried it with anew checkbox, and now it works, stange! But ended building the app around that instead, cheers for the help 🙂 

Community Support Team
Community Support Team

Re: Remove after Patch

Hi @TCH ,

The right syntax of Romove is:

Remove( DataSource, Record1 [, Record2, ... ] [, All ] )

So please modify your formula like this:

If('Monday()_1'.Value = true;
Remove(Monday;LookUp(Monday;Titel=User().Email)));;

Here's a doc about this function for your reference:

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

 

 

Best regards,

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
Users Online
Currently online: 172 members 5,649 guests
Please welcome our newest community members: