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

Collections Patch, with If

Hello

I am new to PowerApps and trying to patch using ForAll with a condition using If a value is greater than 0.

Here is part of my formula, I've tried several versions without success. Any help is appreciated.
ForAll(IncomeCollection, If(IncAmt.Value > 0), Patch(IncomeDetails, Defaults(IncomeDetails), {Income_Amount: IncAmt}))

Thanks

Adrian

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III
Super User III

Hi @adrianlochan ,

 

Change your formula as below:

ForAll(IncomeCollection, (If(IncAmt.Value> 0, Patch(IncomeDetails, Defaults(IncomeDetails), {Income_Amount: IncAmt})))

 

I hope this resolved your issue if you see any challenge let me know I am always happy to help.

 

Regards,

Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Hello @KrishnaV Krishna,

Thanks for the reply, that was helpful.
However along with the If in brackets I found that for me I had to take out the .Value and it worked.

View solution in original post

2 REPLIES 2
Super User III
Super User III

Hi @adrianlochan ,

 

Change your formula as below:

ForAll(IncomeCollection, (If(IncAmt.Value> 0, Patch(IncomeDetails, Defaults(IncomeDetails), {Income_Amount: IncAmt})))

 

I hope this resolved your issue if you see any challenge let me know I am always happy to help.

 

Regards,

Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Hello @KrishnaV Krishna,

Thanks for the reply, that was helpful.
However along with the If in brackets I found that for me I had to take out the .Value and it worked.

View solution in original post

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (31,424)