cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simms7400
Post Prodigy
Post Prodigy

Can I use a RemoveIf and UpdateIf together?

Hi Folks -

 

I have a situation where I need to remove a record from another table, but then update a field in the current table.  The following logic is working as expected:

If(
	CountRows(Filter(rdPartner_Pending,Coalesce(InvestmentEditForm.LastSubmit.ProjectCode in Title,InvestmentEditForm.LastSubmit.ProjectAlias in Title)))>0 && 
		InvestmentEditForm.LastSubmit.Partnered.Value<>"Request Partner",
		RemoveIf(rdPartner_Pending,Title=Coalesce(InvestmentEditForm.LastSubmit.ProjectCode,InvestmentEditForm.LastSubmit.ProjectAlias))
);

 

However, I want to also add in this:

UpdateIf(rdInvestments,ProjectCode=InvestmentEditForm.LastSubmit.ProjectCode,	{Comments:Blank()})

 

rdInvestments is the SharePoint list that the current form is pointing to. I tried to string together like this but no luck:

If(
	CountRows(Filter(rdPartner_Pending,Coalesce(InvestmentEditForm.LastSubmit.ProjectCode in Title,InvestmentEditForm.LastSubmit.ProjectAlias in Title)))>0 && 
		InvestmentEditForm.LastSubmit.Partnered.Value<>"Request Partner",
		RemoveIf(rdPartner_Pending,Title=Coalesce(InvestmentEditForm.LastSubmit.ProjectCode,InvestmentEditForm.LastSubmit.ProjectAlias)) &&
		UpdateIf(rdInvestments,ProjectCode=InvestmentEditForm.LastSubmit.ProjectCode,	{Comments:Blank()})
);
	

 

Is this possible at all?

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @simms7400 ,

Small change as below should work (; instead of &&)

If(
   CountRows(
	  Filter(
         rdPartner_Pending,
         Coalesce(
            InvestmentEditForm.LastSubmit.ProjectCode in Title,
            InvestmentEditForm.LastSubmit.ProjectAlias in Title
         )
      )
   )>0 && 
   InvestmentEditForm.LastSubmit.Partnered.Value<>"Request Partner",
   RemoveIf(
      rdPartner_Pending,
      Title=Coalesce(
         InvestmentEditForm.LastSubmit.ProjectCode,
         InvestmentEditForm.LastSubmit.ProjectAlias
      )
   );
   UpdateIf(
      rdInvestments,
      ProjectCode=InvestmentEditForm.LastSubmit.ProjectCode,
      {Comments:Blank()}
   )
)

 

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.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @simms7400 ,

Small change as below should work (; instead of &&)

If(
   CountRows(
	  Filter(
         rdPartner_Pending,
         Coalesce(
            InvestmentEditForm.LastSubmit.ProjectCode in Title,
            InvestmentEditForm.LastSubmit.ProjectAlias in Title
         )
      )
   )>0 && 
   InvestmentEditForm.LastSubmit.Partnered.Value<>"Request Partner",
   RemoveIf(
      rdPartner_Pending,
      Title=Coalesce(
         InvestmentEditForm.LastSubmit.ProjectCode,
         InvestmentEditForm.LastSubmit.ProjectAlias
      )
   );
   UpdateIf(
      rdInvestments,
      ProjectCode=InvestmentEditForm.LastSubmit.ProjectCode,
      {Comments:Blank()}
   )
)

 

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.

View solution in original post

@WarrenBelz  Thank you my friend, it worked flawlessly! I didn't realize you can use ; in that situation.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,096)