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 / How not to update the ...
Power Apps
Unanswered

How not to update the "countrows/count if" formula when modifying a form ?

(1) ShareShare
ReportReport
Posted on by 4

Hello, 

 

I am having issue with the "countrows"/countif formula. Indeed, I'm trying to have an automatic text written in a sharepoint list when creating a new form. The formula is like this : 

"TSDL_" & Year(Today()) &" _ " &  CountIf('Deviations';true)
Then I have a automatic codified list.
 
The problem occur when I try to modify any form created. The formula updates too. How can I solve this issue please ? I would like to count the row of the forms and not count every rows when modifying.
 
Thanks so much for any hints or help.
Capture d'écran 2024-07-04 153556.png
Capture d'écran 2024-07-04 153717.png
Categories:
  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    I assume you have two different buttons one for edit and one for create record.

    just use a Variable to safe where you are comming from 

    //Create new Record
    Set(varNew, true)
    
    //Edit Record
    (Set(varNew,false)

     

    And then just add an IF statement: 

    IF(varNEw, "TSDL_" & Year(Today()) &" _ " & CountIf('Deviations';true),Parent.Text)

    Let me know if it helped you.

     

     

  • Alex_msb Profile Picture
    4 on at

    Hello thank you for the answer. To clarify, the create and edit buttons are directly in my sharepoint list.  I cannot use a variable in the list I think. 

     

    Do you think there is a way to prevent an edit of the formula ? 

  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    Maybe you could do it like this but I'm not sure you would need to test this. 

    If(IsBlank(Self.Text),"TSDL_" & Year(Today()) &" _ " & CountIf('Deviations';true))

     

  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    Just came to my mind can you display the CreatedOn column. If yes you can use it as a factor to create the logic. If it is Blank create the name otherwise do nothing or if the date is equal to today depending on how the column would be displayed.

     

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 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard