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 / Can i prevent adding a...
Power Apps
Answered

Can i prevent adding a value inside a child SharePoint list if the Sum of certain value for all the child under a parent record exceeds a number

(0) ShareShare
ReportReport
Posted on by 3,514

I have 2 Parent/Child SharePoint lists:-

 

1) Project Master

2) Activities

 

The Activities list has a lookup field to the Project Master, as follow:-

 

johnjohn123_0-1630355095032.png

 

now the Activities Child list contain a field named task weight of type numeric>> and i want to prevent having the sum of all tasks weight under certain project to exceed 100.. so when i add/edit an activity item inside a power app form >> can i Sum the weight for all the other tasks + the task been created/edit and show a message if the sum exceed 100?

 

thanks

Categories:
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @johnjohn123 ,

     

    You could use if() function and notify() function.

    I did a demo for you.

    I have a parent list 'LIST160' and a son list 'LIST161'. 'LIST161' has a lookup column to 'LIST160'. Its related column is ID column. If I want to patch a new item ,i could use If() function .

    vxiaochenmsft_0-1630373539592.png

    vxiaochenmsft_5-1630373646633.png

     

    Add a button control and set its onselect property to:

    If(Value(TextInput1.Text)+Sum(Filter(LIST161,MyLookup_to_LIST160.Value=1),MyNumber)<=100,Patch(LIST161,Defaults(LIST161),{Title:"Test3",MyNumber:Value(TextInput1.Text),MyLookup_to_LIST160:{Id:1,Value:1}}),Notify("Error",NotificationType.Error))

     

    vxiaochenmsft_1-1630373586563.png

     

    The result is as follows:

    vxiaochenmsft_2-1630373603664.png

    vxiaochenmsft_3-1630373613591.png

    vxiaochenmsft_4-1630373626299.png

     

    Best Regards,

    Wearsky

     

     

     

     

     

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard