web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch and update is no...
Power Apps
Unanswered

Patch and update is not working properly in Canvas app

(0) ShareShare
ReportReport
Posted on by 15

Hi,

Good Day...

I have created a canvas app which is connected with excel source in onedrive. First, the app allows user to see the record and enter their number in Input text box, so, the RAG (Red, Amber, Green) button will change its color and text based on user input and it works fine. Also, the RAG text should be captured in RAG column in excel. So I have used the Patch function Onsuccess of Editform to achieve this, unfortunately it is taking stale data sometimes, not updating anything sometimes and also not working as expected. 

 

Secondly, the update function is not updating a value in all the records if any blank in between the records in a column.

 

Patch Function Formula used in my app:

I used this formula in OnSuccess of Editform and tried with OnSelect of Save button as well still it is not working properly.

Patch( Table, Editform.LastSubmit,
	{ RAG_status: If(
		Value(Greenvalue.Text) < Value(Redvalue.Text),
		with(
			{input: Value(Input.Text)},
			If(
				input >= Value(Redvalue.Text),"Red",
				input <=Value(Greenvalue.Text),"Green",
				input <Value(Redvalue.Text),"Amber"
			)
		),
		with(
			{input: Value(Input.Text)},
			If(
				input >= Value(Greenvalue.Text),"Green",
				input <=Value(Redvalue.Text),"Red",
				input >Value(Redvalue.Text),"Amber"
			)
		)
	)
})

 

Update Function:

This one I am using OnSelect of a Clear button to clear all the records of the specific columns.

UpdateIf( Table, true, {Input:"", RAG_Status:""})

 

Please help me fix this issue.

 

Thanks in advance.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,030 Most Valuable Professional on at

    Hi @Kumaranvrbi ,

    Turn on Formula Level Error Management in Advanced Settings as see if that solves it.

     

    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.

    Visit my blog Practical Power Apps

     

     

  • kumaranbi Profile Picture
    15 on at

    Hi WarrenBelz,

     

    Thanks for the help. Unfortunately, it is not working as expected.

     

    I can find this Formula-level error management option under:

    Once I edit app>>Settings>>Upcoming features>>Experimental

     

    I am using standard version of Power apps.

     

     

  • WarrenBelz Profile Picture
    153,030 Most Valuable Professional on at

    Hi @Kumaranvrbi ,

    The function is for a bug regarding writing blank records - if that does not work, try  this as well

    Patch(
     Table, 
     Editform.LastSubmit,
     {
     RAG_status: 
     With(
     {input: Value(Input.Text)},
     If(
     Value(Greenvalue.Text) < Value(Redvalue.Text),
     If(
     input >= Value(Redvalue.Text),
     "Red",
     input <= Value(Greenvalue.Text),
     "Green",
     input < Value(Redvalue.Text),
     "Amber"
     ),
     If(
     input >= Value(Greenvalue.Text),
     "Green",
     input <=Value(Redvalue.Text),
     "Red",
     input >Value(Redvalue.Text),
     "Amber"
     )
     )
     )
     }
    )

     

    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.

    Visit my blog Practical Power Apps

     

  • kumaranbi Profile Picture
    15 on at

    Thank you Warren,

     

    I will try this one.

  • kumaranbi Profile Picture
    15 on at

    Hi Warren,

    I tried this formula but this also fetching wrong data.

  • WarrenBelz Profile Picture
    153,030 Most Valuable Professional on at

    Hi @Kumaranvrbi ,

    This is a logic rather than a data exercise and I don't currently understand fully the logic of your desired result. Can you please summarise as briefly as possible exactly what you are trying to achieve.

  • WarrenBelz Profile Picture
    153,030 Most Valuable Professional on at

    Hi @Kumaranvrbi ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

    Visit my blog Practical Power Apps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard