i have an app in SPO that records values entered by users to a SPO List... because in most cases users should enter only some values(work) and very rarely other values (travel) i flag the items with these two flags... so i can patch only those values that have changed... one item has work as well as trip but rarely both are changed...
when i run the save button with this, it will change all values for Time (first part) but only first value of Trip, no idea why
//patching values to tna table if work time changed
ForAll(RenameColumns(Filter(Gallery3.AllItems,'changed-work'.Value=true), "ID", "ID2"),
Patch('Attendance Calendar', LookUp('Attendance Calendar',ID=ID2),
{ StartTime:If(IsBlank(from.Text),Blank(),from.Text), EndTime: If(IsBlank(to.Text),Blank(),to.Text), TimeAtWork: If(IsBlank(hoursworked.Text),Blank(),Value(hoursworked.Text)), BreakInHours: If(IsBlank(break.Text),Blank(),Value(break.Text)) } ));
//patching values to tna table if travel time changed
ForAll(RenameColumns(Filter(Gallery3.AllItems,'changed-trip'.Value=true), "ID", "ID2"),
Patch('Attendance Calendar', LookUp('Attendance Calendar',ID=ID2),
{ PassiveTravelTimeStart: If(IsBlank(pttstart.Text),Blank(),pttstart.Text), PassiveTravelTimeEnd: If(IsBlank(pttend.Text),Blank(),pttend.Text), PassiveTravelTimeDurringWorkTime: If(IsBlank(pttdw.Text),Blank(),pttdw.Text) } ));
Since it appears that you are trying to set columns to Blank(), make sure that you have the "Formula-level error management" turned on in your advanced settings.
Also you can consider refactoring your formula to the following for a little better performance and maintainability:
//patching values to tna table if work time changed
ForAll(
RenameColumns(
Filter(Gallery3.AllItems,'changed-work'.Value),
"ID", "ID2"
),
UpdateIf('Attendance Calendar', ID=ID2,
{ StartTime:from.Text, EndTime: to.Text, TimeAtWork: Value(hoursworked.Text), BreakInHours: Value(break.Text) }
)
);
//patching values to tna table if travel time changed
ForAll(
RenameColumns(
Filter(Gallery3.AllItems,'changed-trip'.Value),
"ID", "ID2"
),
UpdateIf('Attendance Calendar', ID=ID2,
{ PassiveTravelTimeStart: pttstart.Text, PassiveTravelTimeEnd: pttend.Text, PassiveTravelTimeDurringWorkTime: pttdw.Text }
)
);
I hope this is helpful for you.
thanks @RandyHayes but this works only if i dont exceed 2000 lines as far i see (it was not working when i set the row limit to 30)
Are you referring to the UpdateIf? If so, it is fully delegable with the formula I provided, so there should be no issues with limits. Or are you referring to some other error/issue you are seeting?
yes to the udpate if... if i set the row limit to extreme 30 rows it was not changing values....
I am not seeing that issue. Just in case there has been some new version that was breaking what should work, I just performed a simple test. SharePoint list has 23 items in it. Record limit set to 10. UpdateIf(source, ID=19, {....}) worked perfectly!
So that is fine. There has to be some other factor in your formula that is causing the issue. So, regarding the formula that I replied with, which part is having the issue, the first block or the second?
i cant really tell which part is the problem, will look into it tomorrow again if i figure out i let you know
i have no idea:
the gallery items:
Filter('Attendance Calendar',UPN=upn_label_5.Text, YearMonth=Dropdown_month.SelectedText.Result)
(UPN_LABEL_5 is just UPN of a user)
YearMonth is a dropdown:
Distinct(Filter('Attendance Calendar',MonthlyApproval="Open", UPN=upn_label_5.Text).YearMonth,YearMonth).Result
but never mind, i give up on this, since its not such tragedy of time. thanks for your effort
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
182 | |
47 | |
46 | |
34 | |
33 |
User | Count |
---|---|
260 | |
87 | |
79 | |
68 | |
67 |