If(
Dropdown1.Selected.Value = "--Select--" || Dropdown2.Selected.Value = "--Select--" || Dropdown5.Selected.Value = "--Select--" || IsBlank(DataCardValue2.Text) || IsBlank(DataCardValue4.Text) || IsBlank(ComboBox1.Selected) || IsBlank(ComboBox1_1.Selected) || IsBlank(ComboBox2_5.Selected) || IsBlank(ComboBox1.Selected.DisplayName) || DatePicker2.SelectedDate < Today() || DatePicker1.SelectedDate < Today(),
Notify(
"Please fill the form and ensure the selected date is not in the past",
NotificationType.Warning
),
If(
!IsBlank(
LookUp(
ResourceAllocation_AvailableResources,
Resources = ComboBox1.Selected.DisplayName
).'Project1 Name'
) && !IsBlank(
LookUp(
ResourceAllocation_AvailableResources,
Resources = ComboBox1.Selected.DisplayName
).'Project2 Name'
),
Notify(
"Resource " & ComboBox1.Selected.DisplayName & " is allocated to both projects.",
NotificationType.Warning
),
If(
IsBlank(
LookUp(
ResourceAllocation_AvailableResources,
(Resources = ComboBox1.Selected.DisplayName || Resources = ComboBox2.Selected.DisplayName || Resources = ComboBox3.Selected.DisplayName || Resources = ComboBox4.Selected.DisplayName || Resources = ComboBox5.Selected.DisplayName)
).'Project1 Name'
),
UpdateIf(
ResourceAllocation_AvailableResources,
(Resources = ComboBox1.Selected.DisplayName || Resources = ComboBox2.Selected.DisplayName || Resources = ComboBox3.Selected.DisplayName || Resources = ComboBox4.Selected.DisplayName || Resources = ComboBox5.Selected.DisplayName),
{
Allocation1: PowerPlatformLabel.Text,
'Total Engagements this month': If(
'Total Engagements this month' = "2",
"2",
"1"
),
'Project1 Name': ProjectNameLabel.Text,
'P1 Start Date': StartDateLabel.Text,
'P1 End Date': EndDateLabel.Text,
Project1UniqueId: DataCardValue12.Text,
'Project1 Category': Dropdown1.SelectedText.Value,
'TL1 MailId': DataCardValue26.Text,
'P1 Reporting Manager': ComboBox2_5.Selected.DisplayName
}
);
ResourceAllocationMail.Run(
If(
!IsBlank(ComboBox1.Selected.Mail),
ComboBox1.Selected.Mail,
""
) & If(
!IsBlank(ComboBox2.Selected.Mail),
", " & ComboBox2.Selected.Mail,
""
) & If(
!IsBlank(ComboBox3.Selected.Mail),
", " & ComboBox3.Selected.Mail,
""
) & If(
!IsBlank(ComboBox4.Selected.Mail),
", " & ComboBox4.Selected.Mail,
""
) & If(
!IsBlank(ComboBox5.Selected.Mail),
", " & ComboBox5.Selected.Mail,
""
),
DataCardValue2.Text,
ComboBox2_5.Selected.DisplayName
);
SubmitForm(Form1),
If(
IsBlank(
LookUp(
ResourceAllocation_AvailableResources,
(Resources = ComboBox1.Selected.DisplayName || Resources = ComboBox2.Selected.DisplayName || Resources = ComboBox3.Selected.DisplayName || Resources = ComboBox4.Selected.DisplayName || Resources = ComboBox5.Selected.DisplayName)
).'Project2 Name'
),
UpdateIf(
ResourceAllocation_AvailableResources,
(Resources = ComboBox1.Selected.DisplayName || Resources = ComboBox2.Selected.DisplayName || Resources = ComboBox3.Selected.DisplayName || Resources = ComboBox4.Selected.DisplayName || Resources = ComboBox5.Selected.DisplayName),
{
Allocation2: PowerPlatformLabel.Text,
'Total Engagements this month': If(
'Total Engagements this month' = "2",
"2",
"1"
),
'Project2 Name': ProjectNameLabel.Text,
'P2 Start Date': StartDateLabel.Text,
'P2 End Date': EndDateLabel.Text,
Project2UniqueId: DataCardValue12.Text,
'Project2 Category': Dropdown1.SelectedText.Value,
'TL2 MailId': DataCardValue26.Text,
'P2Reporting Manager': ComboBox2_5.Selected.DisplayName
}
);
ResourceAllocationMail.Run(
If(
!IsBlank(ComboBox1.Selected.Mail),
ComboBox1.Selected.Mail,
""
) & If(
!IsBlank(ComboBox2.Selected.Mail),
", " & ComboBox2.Selected.Mail,
""
) & If(
!IsBlank(ComboBox3.Selected.Mail),
", " & ComboBox3.Selected.Mail,
""
) & If(
!IsBlank(ComboBox4.Selected.Mail),
", " & ComboBox4.Selected.Mail,
""
) & If(
!IsBlank(ComboBox5.Selected.Mail),
", " & ComboBox5.Selected.Mail,
""
),
DataCardValue2.Text,
ComboBox2_5.Selected.DisplayName
);
SubmitForm(Form1)
)
)
)
)
Im using this above formula in power apps ,Im having issue with updateif , whenever i fill the form with resource1(ex:xyz) the the details will be stored in project1 and second time if i fill the form with resource1(ex:xyz) and resource2(ex:abc),what is happening is for resource1(ex:xyz) it goes and store in project2 but for resource2(ex:abc) also it stores in project2,i dont want this to happen ,i want for resource1(ex:xyz) it has to store in project2 and for resource2(ex:abc) it has to store in project1
Thank You