Hi, I'm having an issue when editing a record. Each time I edit a record, I check to confirm if the Date already exists in the SharePoint list and if the Date is outside the defined Pay Period dates. IF the Date exist, I want to receive a popup that indicates Date exist - which it does. But on confirmation of the popup, I always get a second popup, confirming Date exist. And if the new date selected is outside the pay period, I get a popup stating that message. And then I also get another popup stating the Date exist??? Here is my code, hope someone can help me sort this logic. Also on the quit of the confirmation popup screens, I am clearing all data.
If(!IsBlank(LookUp(BonusInput, varEditEmployeeBonusSelected.TimeID = TimeID And DataCardValue11.SelectedDate=Date,ID)),UpdateContext({varEditConfirmDateExist:true}), DataCardValue11.SelectedDate < varPayPeriodSelectedDropdownStartDate || DataCardValue11.SelectedDate > varPayPeriodSelectedDropdownEndDate, UpdateContext({varEditShowPopUpConfirmSelectedDate:true}),UpdateContext({varEditConfirmDateExist:false});)
Solved! Go to Solution.
Hi @TB05 ,
There are several syntax mistakes in your code:
If(
!IsBlank(
LookUp(
BonusInput,
varEditEmployeeBonusSelected.TimeID = TimeID
And DataCardValue11.SelectedDate=Date,ID
)
),
UpdateContext({varEditConfirmDateExist:true}),
[Should have the 'false' statement, but instead another condition is provided]
DataCardValue11.SelectedDate < varPayPeriodSelectedDropdownStartDate
|| DataCardValue11.SelectedDate > varPayPeriodSelectedDropdownEndDate,
UpdateContext(
{varEditShowPopUpConfirmSelectedDate:true}
),
UpdateContext(
{varEditConfirmDateExist:false}
);
)
Please try with the below which is correct from syntax perspective:
If(
!IsBlank(
LookUp(
BonusInput,
varEditEmployeeBonusSelected.TimeID = TimeID
And DataCardValue11.SelectedDate=Date
)
),
UpdateContext(
{varEditConfirmDateExist:true}
),
If(
DataCardValue11.SelectedDate < varPayPeriodSelectedDropdownStartDate
|| DataCardValue11.SelectedDate > varPayPeriodSelectedDropdownEndDate,
UpdateContext(
{varEditShowPopUpConfirmSelectedDate:true}
),
UpdateContext(
{varEditConfirmDateExist:false}
)
)
)
Hi @TB05 ,
There are several syntax mistakes in your code:
If(
!IsBlank(
LookUp(
BonusInput,
varEditEmployeeBonusSelected.TimeID = TimeID
And DataCardValue11.SelectedDate=Date,ID
)
),
UpdateContext({varEditConfirmDateExist:true}),
[Should have the 'false' statement, but instead another condition is provided]
DataCardValue11.SelectedDate < varPayPeriodSelectedDropdownStartDate
|| DataCardValue11.SelectedDate > varPayPeriodSelectedDropdownEndDate,
UpdateContext(
{varEditShowPopUpConfirmSelectedDate:true}
),
UpdateContext(
{varEditConfirmDateExist:false}
);
)
Please try with the below which is correct from syntax perspective:
If(
!IsBlank(
LookUp(
BonusInput,
varEditEmployeeBonusSelected.TimeID = TimeID
And DataCardValue11.SelectedDate=Date
)
),
UpdateContext(
{varEditConfirmDateExist:true}
),
If(
DataCardValue11.SelectedDate < varPayPeriodSelectedDropdownStartDate
|| DataCardValue11.SelectedDate > varPayPeriodSelectedDropdownEndDate,
UpdateContext(
{varEditShowPopUpConfirmSelectedDate:true}
),
UpdateContext(
{varEditConfirmDateExist:false}
)
)
)
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
186 | |
95 | |
62 | |
59 | |
58 |
User | Count |
---|---|
251 | |
164 | |
93 | |
79 | |
70 |