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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with error alert ...
Power Apps
Answered

Help with error alert - alert to prompt if values of 2 columns are not matching

(0) ShareShare
ReportReport
Posted on by 10

Hello,

 

I was trying to create a editable grid in Powerapps & I'm stuck with a validation scenario - if for example, I am comparing a column in a grid to another (assume comparing amount in one sharepoint list column to amount in another column) and if the amount does not match, the grid should color the border of another (amount mismatch) dropdown reason column as red wherein the reason needs to be selected for amount mismatch.

 

And the validation (while submitting the save button) would also need to show that if there is a mismatch of amounts, check whether the mandatory reason dropdown is selected. I was able to do the work with the grid color of the dropdown, but for further validation within the Save Button, I'm not able to work the logic. Any suggestion there as to how can I write the query for the app to validate whether if there is a amount mismatch & if reason for mismatch reason dropdown is blank then throw a notify error?

 

I am attaching a screenshot of the 3 columns in grid wherein the dropdown - Mismatch reason needs to be validated (updated) based on the condition that the Planned Charge amount is not equal to Charged Amount & pass it as is without the need of dropdown (for rows where planned charge = Charged Amount) if the amount matches.

001.png
Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @rho_s ,

     

    Is it a Gallery control? If it is, then BorderColor of the cell could be set to below:

    If(PlannedCharge.Text = ChargedAmount.Text, RGBA(0, 18, 107, 1), Color.Red)

    vjefferni_0-1703576464448.png

     

    Best regards,

  • rho_s Profile Picture
    10 on at

    @v-jefferni Thanks! I figured that one out & the highlight cells work well. However, the issue is with the code to prompt the user if he/she is not selecting the "mismatch reason" from the dropdown if the planned charge has a mismatch to the charged amount for the same row. I am posting a part of the code that I am trying to add to the save button, but it does not work.

     

    If(
     (Planned_Chg.Text <> Charged_Amt.Text) && IsBlank(Mismatch_Reason.Selected),
     Notify(
     "Please Fill Reason for Planned vs Actual Charge Mismatch",
     NotificationType.Error,
     3000
     ),
     Notify(
     "Updated Successfully! Exited EDIT Mode.",
     NotificationType.Success,
     3000
     )),

     

    Adding a view of what I am trying to achieve. In this case, if the user submits (hits save) 455 against 456 without selecting a valid Mismatch reason dropdown option, the Notify should prompt to select a suitable Mismatch reason & if reason is selected, submit the entry. Also, if planned = charged, do not ask for the dropdown mismatch reason.

    002.png

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @rho_s ,

     

    You need to edit the formula as following:

    If(
     !(Planned_Chg.Text <> Charged_Amt.Text && IsBlank(Mismatch_Reason.Selected)),
     Notify(
     "Updated Successfully! Exited EDIT Mode.",
     NotificationType.Success,
     3000
     ),
     Notify(
     "Please Fill Reason for Planned vs Actual Charge Mismatch",
     NotificationType.Error,
     3000
     ),
    ),

     

    Best regards,

  • rho_s Profile Picture
    10 on at

    Thanks for your time. Though the solution did not work completely, it did add a validation of some sorts to the app.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard