I'm trying to count the number of rows that have the value "Open" in a Status field.
if > 1 then
I need to perform and action ?
If(CountRows(Filter('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',Status = "Open", Status)> 1))
Action:
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()
}
)
Thanks
Dave
Solved! Go to Solution.
this is what I used..
If(CountRows(
Filter('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',
Status = "Open",
ID_Racfid = lbl_Racfid_ms.Text
)
)> 1,Set(TheVar,Now());Reset(txt_ReOpenedDate)
;
Hi @DAVIDPOWELL ,
Yes , it possible to take the action based on control,
But this is possible by using ONSelect Property like Button, ICON, Toggle, etc.
See the below reference Screenshot-
Code -
ClearCollect(Coll1,{Value:1});
Clear(Coll1);
//Thisis the Code as you need to impliment like that
If(CountRows(Filter(TestAkshay,Title<>Blank()))>1,Patch(Coll1,Defaults(Coll1),{Value:15}),Notify("No record FOund",NotificationType.Information));
Thanks,
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay
Hi @DAVIDPOWELL ,
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,
this is what I used..
If(CountRows(
Filter('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',
Status = "Open",
ID_Racfid = lbl_Racfid_ms.Text
)
)> 1,Set(TheVar,Now());Reset(txt_ReOpenedDate)
;
Hi @DAVIDPOWELL ,
So have you solved your problem?
If yes, could you mark my answer as solution?
Thanks!
Best regards,
Phoebe
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
204 | |
181 | |
69 | |
36 | |
33 |
User | Count |
---|---|
342 | |
274 | |
115 | |
75 | |
58 |