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 / Increment Column (Number)
Power Apps
Answered

Increment Column (Number)

(0) ShareShare
ReportReport
Posted on by 68

Hi,

 

I have a 2 SharePoint lists:

 

1. Pitches

2. Applicants

 

Users apply to take part in one of the submitted "Pitches" by completing a form.  I have created a Number column called ApplicantCount in the Pitches list and would like to increment the ApplicantCount  column +1 for every applicant.

 

The applicants (applications are captured in the Applicants list.

 

The trigger being OnSelect. The applicant selects the title of the pitch (dropdown) and submits the application.

 

What I want to achieve is that the ApplicantCount  column +1 is incremented with every application. 

 

The Title in both the Ideas and Applicants list are identical. 

 

I assume i need to use either the Update() or Patch() function but am struggling with the syntax.

 

Thanks

 

 

 

 

 

 

 

 

 

 

 

 

Pitch-Application.PNG
Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @marsdendd 

    You have the right idea about using the PATCH function.  I think you will understand the code I have written below.  Please put it in the OnSelect property of your Submit button right at the end.  If you are wondering what to do with DataCardValue_ID.Text, you should include ID as a card on your form but make it non-visible.

     

    Set(myRecord,LookUp(Pitches,ID=DataCardValue_ID.Text));
    Patch(
     Pitches,
     myRecord,
     {ApplicantCount: myRecord.ApplicantCount + 1}
    );

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @marsdendd 

     

    Can you try to update the expression as:

    Patch(
    SPListName,
    Defaults(SpListName),
    {
    ApplicantCount : Value(First(Sort(SPListName, "ApplicantCount", "Descending")).ApplicantCount) + 1
    }
    )

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • marsdendd Profile Picture
    68 on at

    Hi @yashag2255  Thanks for your response. I tried your expression but i fell foul of the "Title Field Required" error and the PitchApplicantCount column is not incremented.

     

    Patch(
     'Pitch Submissions',
     Defaults ('Pitch Submissions'),
     {PitchApplicantCount: Value(
     First(
     Sort(
     'Pitch Submissions',
     "PitchApplicantCount",
     "Descending"
     )
     ).PitchApplicantCount
     ) + 1
     }
    );

     

     

     

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @marsdendd ,

    Please check whether your Title column in required.

    If your Title column is required, you should patch with the Title column's value, or else the record will not update successfully.

    You could check this here:
    11143.PNG

     To solve this problem, you have two ways:

    1)patch with Title value

    for example:

    Patch(
     'Pitch Submissions',
     Defaults ('Pitch Submissions'),
     {PitchApplicantCount: Value(
     First(
     Sort(
     'Pitch Submissions',
     "PitchApplicantCount",
     "Descending"
     )
     ).PitchApplicantCount
     ) + 1,
     Title:....
     }
    );

    2)change Title column not required.

    Please choose Title column , choose "require this column contains information"

    11144.PNG

     

    11145.PNG

     

    Then this column will not be required.

     

     

     

    Best regards,

     

  • Verified answer
    marsdendd Profile Picture
    68 on at

    Thanks to those who responded.

     

    I was over thinking it.

     

    I ended up taking a far simpler route and using CountRows. 

      

    CountRows(Filter('Pitch Applicants',Title = ThisItem.Title))

     

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard