# Can I use action constraint to make this work?

**URL:** <https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164>\
**Category:** V5 Question\
**Created:** [October 18, 2020, 4:15pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164 "2020-10-18T16:15:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 18, 2020, 4:15pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/1 "2020-10-18T16:15:39Z")

</div>

In this rule, SambaPOS will search for a customer then show a question “Are you sure?”. The problem is it will show “Are you sure?” even if no customer found. Is my constraint syntax wrong?

‘{ENTITY DATA:Customer}’ != ‘’ does not work

 ![image](https://forum.sambapos.com/uploads/default/original/3X/b/d/bd8584af1f1a259848f98fddec5107076fd46258.png)

---

<div class="post-metadata">

**Author:** ![markjw](https://forum.sambapos.com/user_avatar/forum.sambapos.com/markjw/32/9942_2.png) [@markjw](https://forum.sambapos.com/u/markjw)\
**Post date:** [October 18, 2020, 5:05pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/2 "2020-10-18T17:05:58Z")

</div>

Constraints are calculated when the rule is run, therefore they won’t take into account any changes made in previous actions within that rule. So in your case you search for the entity but even when the new entity is selected, it won’t affect that constraint as it was checked when the rule was first run. You will need to pass to a new rule to be able to check that constraint after you did the search.

---

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 18, 2020, 5:19pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/3 "2020-10-18T17:19:40Z")

</div>

Thank you! Can you tell me which action might help me check the search customer entity result and then I can return to the LC-ClaimPointsConfirmation if the result is not null?

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [October 18, 2020, 7:49pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/4 "2020-10-18T19:49:49Z")

</div>

you need to add an automation command action into that rule after your 2nd action, then remove the 3rd action and put it in a new auto command rule which is triggered from the auto command action you will add in that rule above

You need to split the 3rd action into a rule of its own to run after the rule posted above with just the first 2 actions in it

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [October 18, 2020, 7:50pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/5 "2020-10-18T19:50:09Z")

</div>

If you need multistep you can use execute automation command, ie first rule selects entity, execute seccond rule, seccond rule contains constraint based on entity selected.

---

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 19, 2020, 12:28am UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/6 "2020-10-19T00:28:36Z")

</div>

My constraint won’t work for sure, can you give me a correct one idea? I’m going back to the bad ‘{ENTITY DATA:Customer}’ == ‘’ case.

 ![image](https://forum.sambapos.com/uploads/default/original/3X/2/8/28ea6802191ae8e2e8b8c184ead8f116634fc9f9.png)

---

<div class="post-metadata">

**Author:** ![Posflow](https://forum.sambapos.com/user_avatar/forum.sambapos.com/posflow/32/63001_2.png) [@Posflow](https://forum.sambapos.com/u/Posflow)\
**Post date:** [October 19, 2020, 3:33am UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/7 "2020-10-19T03:33:46Z")

</div>

What entity data though? You are calling for entity data but not specifying which one.

```auto
'{ENTITY DATA:Customer:WhatCustomDataFieldHere}' != ''

```

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [October 19, 2020, 7:39am UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/8 "2020-10-19T07:39:10Z")

</div>

try ‘{ENTITY NAME:Customer}’ instead

and check it is Customer and not Customers

---

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 19, 2020, 10:54am UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/9 "2020-10-19T10:54:17Z")

</div>

Sadly, whatever I do

‘{ENTITY DATA:Customer:FullName}’ != ‘’  
‘{ENTITY DATA:Customer:FullName}’ == ‘’  
‘{ENTITY NAME:Customer}’ != ‘’  
‘{ENTITY NAME:Customer}’ == ‘’

The action always turns to No, even if search action found a customer or not.

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [October 19, 2020, 11:05am UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/10 "2020-10-19T11:05:22Z")

</div>

show a screenshot of your entity settings

---

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 19, 2020, 11:08am UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/11 "2020-10-19T11:08:44Z")

</div>

It’s basically the default Customer entity.

![image](https://forum.sambapos.com/uploads/default/original/3X/a/4/a42de100d44becd774385cc90c507e08a00eefed.png)

![image](https://forum.sambapos.com/uploads/default/original/3X/8/6/8674af5fd7f886bf3c0ddf870a44dc5fc9f1dd9b.png)

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [October 19, 2020, 12:17pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/12 "2020-10-19T12:17:41Z")

</div>

Where are you executing that from? Are you in an open ticket? Are you sure it can read Entity Data? Is an Entity Loaded or a ticket open for it to read from?

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [October 19, 2020, 12:22pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/13 "2020-10-19T12:22:23Z")

</div>

You are still trying to use an action constraint that needs a previous action in the same rule. That won’t work as Mark already pointed out.

---

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 19, 2020, 12:28pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/14 "2020-10-19T12:28:42Z")

</div>

Yeah, I’m pretty sure the rule was run in an open ticket. Entity loaded just fine too.

---

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 19, 2020, 12:30pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/15 "2020-10-19T12:30:48Z")

</div>

You’re right, I see no reason for this rule to work. It is just the same with what I did in the beginning. Do you have an idea to get me out? I feel so dull up until this point. 😑

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [October 19, 2020, 12:35pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/16 "2020-10-19T12:35:29Z")

</div>

Execute the automation command. Don’t constrain it. Pass a value with it and the constrain it.

---

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 19, 2020, 3:52pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/17 "2020-10-19T15:52:02Z")

</div>

Still not work, maybe I understand wrongly the meaning of pass a value in your post or maybe there must be something wrong with the way I do constraint.

 ![image](https://forum.sambapos.com/uploads/default/original/3X/3/5/354a4aad8e64e4e62c128217f026c7cf06b60a5b.png)

 ![image](https://forum.sambapos.com/uploads/default/original/3X/7/f/7fb3b1df62fad595c01bc61d0bac984a3a575f1b.png)

---

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 19, 2020, 3:57pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/18 "2020-10-19T15:57:56Z")

</div>

Oh, I didn’t put brackets into constraint, will check and get back soon.

---

<div class="post-metadata">

**Author:** ![Posflow](https://forum.sambapos.com/user_avatar/forum.sambapos.com/posflow/32/63001_2.png) [@Posflow](https://forum.sambapos.com/u/Posflow)\
**Post date:** [October 20, 2020, 1:26am UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/19 "2020-10-20T01:26:18Z")

</div>

Yes you are mising {}

Also, that action will be executed if ‘FullName’ is empty. Is that what you are trying to achieve?

My guess would be that you want to do use loyalty points if the name is not empty. So

```auto
 '{ENTITY NAME:Customer}' != '' 

```

---

<div class="post-metadata">

**Author:** ![setawild](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@setawild](https://forum.sambapos.com/u/setawild)\
**Post date:** [October 22, 2020, 5:50pm UTC](https://forum.sambapos.com/t/can-i-use-action-constraint-to-make-this-work/23164/20 "2020-10-22T17:50:30Z")

</div>

I’m sorry for a late feedback. It works now, exactly with what you guys have tried telling me to! Thank you so much, I’m really appreciate your help and your patience explaining this matter to me.
