I have a powerapps gallery with SharePoint as the datasource. I can create multiple events in calendar year. Below is the screenshot for the same.
Once the events has been created and if i click on Event 1 View button, it will redirect me to the events detail page. Screenshot included below.
If i click on Event 2 View button, it should redirect me to the above screen, however all the checkbox checked in the Event 1 screen should appear unchecked and i can select whatever items i need for Event 2.
Similarly if i create Event 3, it should also have same behaviour.
By default, all the items has status "Ready for Purchase".
I also have submit button for each event. Once i click on submit button, it should patch the datasource with Status column as "Ready for Sale". Also, if items with Status "Sold Out" in Event 1, should not appear again for future events.
I have included the code below for Event details page. Should i be creating separate collection for each events to track the checked and unchecked items? I am not in favor of creating separate collections because if users create 7 events or more, it will have that much collections. Any advice on how to tackle this scenario would be much appreciated.
Gallery Items property
Filter(
colListData1,
(Len(SearchText_3.Text) = 0 || (SearchText_3.Text in 'Item Name' || SearchText_3.Text in Qty || SearchText_3.Text in 'Unit Price')) && (ComboBox9.Selected.Value = "All" || (ComboBox9.Selected.Value = "Checked Items" && checkBoxVal && EventID = currentevent.ID) || (ComboBox9.Selected.Value = "Unchecked Items" && (!checkBoxVal)))
)
Gallery CheckBox OnCheck
UpdateIf(
colListData1,
ID = ThisItem.ID,
{checkBoxVal: true,EventID:currentevent.ID}
)
Gallery CheckBox OnCheck
UpdateIf(
colListData1,
ID = ThisItem.ID,
{checkBoxVal: false,EventID:Blank()}
)
Gallery Checkbox Default
ThisItem.checkBoxVal&&ThisItem.EventID=currentevent.ID
Gallery SelectAll Checkbox at the top OnCheck
With(
{
_temp: colListData1
},
ForAll(_temp,
Patch(colListData1,
ThisRecord,
{
checkBoxVal:true
}
)
)
)
Gallery SelectAll Checkbox at the top OnUnCheck
With(
{
_temp: colListData1
},
ForAll(_temp,
Patch(colListData1,
ThisRecord,
{
checkBoxVal:false
}
)
)
)
Gallery SelectAll Checkbox at the top default
false
Gallery Submit Button
ForAll(
Gallery1_3.AllItems,
Patch(
colListData1,
ThisRecord,
{
Start_Value: Value(TextInput8.Text),
Incremental_Value: Value(ComboBox6.Selected.Value),
checkBoxVal: Checkbox1.Value,
EventID: currentevent.ID,
Status:"Ready for Sale"
}
)
);
Collection at App OnStart
ClearCollect(
colListData1,
AddColumns(Filter(
Items,Item_Status="Ready for Purchase"),
"checkBoxVal",
false
)
)

Report
All responses (
Answers (