Hi @Anonymous ,
Do you want to act an action when there's a status field value is open?
Could you tell me the data type of Status field?
1)If it is text type, you could set one button's OnSelect like this:
If(
CountRows(Filter('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',Status = "Open"))> 1,
Patch('[dbo].[t_nsc_trackcode_DataEntry_pa]',
LookUp( '[dbo].[t_nsc_trackcode_DataEntry_pa]', NSC_Id = Value(txt_NextId.Text)),
{
Status:"Closed",
Closed_Date:varDate//Now()
}
)
)
Or you could also consider use IsEmpty to justify where's record that meet requirement:
If(
!IsEmpty(Filter('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',Status = "Open")),
Patch('[dbo].[t_nsc_trackcode_DataEntry_pa]',
LookUp( '[dbo].[t_nsc_trackcode_DataEntry_pa]', NSC_Id = Value(txt_NextId.Text)),
{
Status:"Closed",
Closed_Date:varDate//Now()
}
)
)
2)If it is choice type, you could set one button's OnSelect like this:
If(
CountRows(Filter('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',Status.Value = "Open"))> 1,
Patch('[dbo].[t_nsc_trackcode_DataEntry_pa]',
LookUp( '[dbo].[t_nsc_trackcode_DataEntry_pa]', NSC_Id = Value(txt_NextId.Text)),
{
Status:{Value:"Closed"},
Closed_Date:varDate//Now()
}
)
)
Or you could also consider use IsEmpty to justify where's record that meet requirement:
If(
!IsEmpty(Filter('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',Status.Value = "Open")),
Patch('[dbo].[t_nsc_trackcode_DataEntry_pa]',
LookUp( '[dbo].[t_nsc_trackcode_DataEntry_pa]', NSC_Id = Value(txt_NextId.Text)),
{
Status:{Value:"Closed"},
Closed_Date:varDate//Now()
}
)
)
Best regards,