
Announcements
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:-
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
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 .
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))
The result is as follows:
Best Regards,
Wearsky