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 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:
I have the same question (0)
  • 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

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard