cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
SaWu
Level 8

Error with Patch and RemoveIf (which are both accepted individually) in If statement

Hi

Please be so kind as to read my full post before responding.
Thank you for your consideration.

I have a strange problem/error (and an easy workaround) with an If formula.
If I put in my then (a Patch formula) and my else (a RemoveIf formula) block, I get an error.

If I split the If into two individual formulas, one each for then and else, I get no errors.
I also use this as an easy workaround.
I don't need help.
I just want to file a "bug" report and maybe get some feedback, preferably from a backend developer, why this "bug" shows up in the first place.

I am assuming that this is some kind of weird bug with the parsing/App-Checking of Patch/RemoveIf in the same If.
image.pngimage.png

For some background info:
I am working on an App for which regular CRM (not customizers!) are supposed to be able do define a variable number of questions (custom entity "WelcomeApp Questions") with a variable number selectable options (custom entity "WelcomeApp Question Options" including LookUp to "WelcomeApp Questions") to ask participants (custom entity "WelcomeApp Participants") of workshops.

The App displays a Gallery of this custom entity.
The gallery template includes just a CheckBox, with the entity label as text, and if the user has selected the option as Default.
The check itself is explained a few lines down.

For the option selection, I use the standard fake-m:n-relationship pattern, i.e. another custom entity "WelcomeApp Participant Answers" which includes one LookUp to "WelcomeApp Options" and one LookUp to "WelcomeApp Participants" (and some additional info like selection time etc).

In Screen.OnVisible, I collect all the options, and also check if the participant has selected it, i.e. there's one record in "WelcomeApp Participant Answers" linking them.
image.png
The code in which I noticed my "bug" is from my Save button.
It checks if the CheckBox Value differs from the (previous Default) record(s) in the CRM.
If yes, and the CheckBox is selected, a new record in "WelcomeApp Participant Answers" is created.
If yes, and the CheckBox is not selected, the old record in "WelcomeApp Participant Answers" linking that particular participant to that particular option is removed.

Thank you,
    Sa.

1 REPLY 1
Community Support Team
Community Support Team

Re: Error with Patch and RemoveIf (which are both accepted individually) in If statement

Hi @SaWu ,

Thanks for your sharing. If you have any questions about PowerApps, please feel free to reply here, I would provide a proper workaround for you.

 

Best regards,

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

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: 175 members 5,297 guests
Please welcome our newest community members: