Hi,
Hoping this is an easy fix, I have a gallery which can be filtered on a number of conditions. I have a button outwith the gallery that will collect the items and patch to a SP List. I also want to update another SP List. It currently updates all the records in the SP.
I want it to only update the records that are filtered in the gallery, or collected in the collection. This is the formula I currently have:
ForAll(
Gallery1_1.AllItems,
Collect(
TestColl,
{
Year: Text(
Today(),
"yyyy"
),
Month: Text(
Today(),
"mmmm"
),
Test: If(
Text(
Today(),
"mmmm"
) = "January",
"Functional",
Text(
Today(),
"mmmm"
) = "Feburary",
"Functional",
Text(
Today(),
"mmmm"
) = "March",
"Functional",
Text(
Today(),
"mmmm"
) = "April",
"Functional",
Text(
Today(),
"mmmm"
) = "May",
"Functional",
Text(
Today(),
"mmmm"
) = "June",
"1hr Duration",
Text(
Today(),
"mmmm"
) = "July",
"Functional",
Text(
Today(),
"mmmm"
) = "August",
"Functional",
Text(
Today(),
"mmmm"
) = "September",
"Functional",
Text(
Today(),
"mmmm"
) = "October",
"Functional",
Text(
Today(),
"mmmm"
) = "November",
"Functional",
Text(
Today(),
"mmmm"
) = "December",
ThisRecord.Dropdown1.SelectedText.Value
),
MasterID: ID,
Signed: Left(
User().FullName,
1
) & Mid(
User().FullName,
Find(
" ",
User().FullName
) + 1,
1
),
Dated: Text(
Today(),
"dd/mm/yyyy"
)
}
)
);
Patch(
LDR_Light,
ForAll(
LDR_Light,
{
ID: ID,
UKDate2: DateAdd(
Today(),
1,
Months
)
}
)
);
ForAll(
TestColl,
Patch(
LDR_Light_Test,
Defaults(LDR_Light_Test),
{
Year: Year,
Month: Month,
Test: Test,
Title: Signed,
Dated: Dated,
MasterID: MasterID
}
)
);
Clear(TestColl)
The first part of the formula does what i want it to do and collects the filtered data and puts into a Collection. The issue is with the formula:
Patch(
LDR_Light,
ForAll(
LDR_Light,
{
ID: ID,
UKDate2: DateAdd(
Today(),
1,
Months
)
}
)
);
This updates all records in the SP List - LDR_Light. But what i want to achieve is that it only updates the records that are filtered in the Gallery.
Hope this makes sense, any help would be appreciated.
Solved! Go to Solution.
as soon as I posted this I found the answer. used the solution in this post:
https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-from-a-filtered-Gallery/td-p/766165
as soon as I posted this I found the answer. used the solution in this post:
https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-from-a-filtered-Gallery/td-p/766165