Hi,
I have a ForAll Patch and inside is an IF statement. This is a checkbox status. If the status is in "Created" and it is OnCheck then it should change it's status in "Ready". But my IF statement is not working.
ForAll(
SelectedItemsColl As sic,
Patch(
'Inspection Request Detail List',
LookUp(
SelectedItemsColl,
ID = sic.ID
),
If(Status.Value in "Created", {Status.Value: "Ready"},
Status.Value in "Ready", {Status.Value: "In-Room"},
Status.Value in "In-Room", {Status.Value: "Presented"},
Status.Value in "Presented",{Status: Inactive, Status.Value: "Closed"}
)
)
);
Can anyone help me to spot where I am doing it wrong? 🙂
Any helps really appreciated! Thank you.
Regards,
May
Do you have four checkboxes on the screen? If you want to take an action when a checkbox is 'checked' then you should refer to that specific checkbox and determine if its true. If yes, then change the status.
Also, you may wish to reverse the order of your code to
ForAll(
SelectedItemsColl As sic,
Patch(
'Inspection Request Detail List',
LookUp(
SelectedItemsColl,
ID = sic.ID
),
If(checkbox_Created.Value=true, {Status.Value: "Ready"},
checkbox_Ready.Value=true, {Status.Value: "In-Room"},
checkbox_InRoom.Value=true, {Status.Value: "Presented"},
checkbox_Presented.Value=true,{Status: Inactive, Status.Value: "Closed"}
)
)
);
---
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."
Hi @mdevaney ,
Thank you for your reply.
Yes, I have a checkbox and an arrow to help move:
But still it give me error 😞
Regards,
May
@mayarnaldo
I don't understand where the checkboxes for status are. Can you please circle them on the screen?
@mdevaney Take a look at this post. I believe it will shed some light on the problem that @mayarnaldo is having.
@mayarnaldo you might want to take a look at my response there as it will simplify what you are trying to do tremendously.