Hi,
I have this logic:

I get value in ComboBox using defaultsiselecteditem from SP list 2, and Item using ["aaaa", "bbbb", "cccc"].
I want if:
1. Value from SP list 2 already exists in ComboBox, then just update the data
2. I just add new value in combobox with that item, then patch new data
3. if combobox still blank, then just dont patch/update
I used this formula, not error but cant work.
Formula:
ForAll(
UpdateDocument_1.AllItems,
If(
IsBlank(
First(
Filter(
'PE Workload',
'Job Description' = JobDesc_Update.Text
)
).'Task (Task0)'
),
// If 'Task (Task0)' is blank, then patch data
Patch(
'PE Workload',
Defaults('PE Workload'),// You may need to adjust this based on your list structure
{
'Job Description': JobDesc_Update.Text,
'Task (Task0)': Task_2.Text,
PIC: Text(PIC_PE_2.Selected.Value),
Title: ProductID_Update.Text,
Customer: Customer_Update.Text,
'% Progress': 0
// Add other fields as needed
}
),
// If 'Task (Task0)' is not blank, then update data
UpdateIf(
'PE Workload',
'Job Description' = JobDesc_Update.Text && 'Task (Task0)' = Task_2.Text,
{
PIC: Text(PIC_PE_2.Selected.Value)
// Add other fields as needed
}
)
)
)
How to do it? Thank you!!!