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 Apps
Unanswered

block duplication

(1) ShareShare
ReportReport
Posted on by 40
Hello, I had a little problem with how I can ensure that we do not have the Name and year column having both the same value at the same time, because a person can evaluate himself once a year and not several times and if by forgetting the person wants to evaluate himself for the second time during the year that the recording is not taken into account with error message.
 
If (CountRows (ColEvaluation)> 0;
ForAll (ColEvaluation; Patch ('EVALUATION'; Defaults ('EVALUATION');
{Name: NAME; age: AGE; job: JOB; year: YEAR OF EVALUATION;
score: SCORE; salary: SALARY } ) ) ) ;;
Capture.PNGClear (InventoryCol) ;; Notify ("Your Data's saved successfull"; NotificationType.Success)
 
 
 
 
Categories:
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Peter_93 

     

    After the ForAll you will need an If - check if the current value is already the same as the current year. If so, have it just be false so the  Patch is not performed for that row. Otherwise, do the Patch.

     

    A rough example (not exact, change it to make sense):

     

     

    If (CountRows (ColEvaluation)> 0;
    ForAll (ColEvaluation; If(year = Year(Now()),false,Patch ('EVALUATION'; Defaults ('EVALUATION');
    {Name: NAME; age: AGE; job: JOB; year: YEAR OF EVALUATION;
    score: SCORE; salary: SALARY } ) ) ) ) ;;

     

    The above example will probably not work as given, it is for rough illustration only, you can check it and change it to make sense for you.

     

     

    If you must show an error message, you can replace false above ion the If(year = Year(Now()),false,... with something like Notify or some formula that shows error message if the user should be advised what row(s) was/were not saved.

     

    Check if above helps.

  • Peter_93 Profile Picture
    40 on at

    Thank you Sir for the answer, By the way the Current year can exist so many times but not at the same time the same name and the same year at the same to avoid an evaluation 2 times, because there can be several times the same year to repeat and the name of the person too

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard