Hello, I'm trying to create a Form Saved Behavior that clears my RESULTS column when there is a data change in my PHONE column.
I tried using this expression in the action for my RESULTS column:
IF([_THISROW_BEFORE].[PHONE] <>[_THISROW_AFTER].[PHONE], "", [RESULTS])
But it's not valid. Would please appreciate any help on getting this correct and thanks in advance!
Please try below. In the action settings for the setting "Constion For action", please enter the expression
[_THISROW_BEFORE].[Phone]<>[_THISROW_AFTER].[Phone]
And in the columns to set of the action , please set [Results] column to change to ""
This will ensure the action only runs when the [Phone] column changes and sets the [Results] column to blank.
Thanks very much for the reply, Suvrutt. I tried exactly as you wrote but the action is still not clearing the Results when the Phone changes. (I'll show you my actual data in the screenshots: N1 RESULTS 1 and N1 PHONE 1.)
-----
I tested it without the Only if to see if it works and it does clear when any data changes but I need it to do so when only N1 PHONE 1 changes. But when I add [_THISROW_BEFORE].[N1 PHONE 1]<>[_THISROW_AFTER].[N1 PHONE 1] to the Only if and I change the data for N1 PHONE 1, no clear occurs. I'm a bit stumped.
Please run that action through a data change BOT . The bot that fires based on condition [_THISROW_BEFORE].[N1 PHONE 1]<>[_THISROW_AFTER].[N1 PHONE 1]
Then you may also remove the condition from action.
I tried in the bot earlier, but I need the expression to run only in my Data Entry view. Otherwise, it will trigger when other views or bots make changes to the Phone columns. So, unfortunately, the bot does not trigger when I use this expression:
AND(
CONTAINS(CONTEXT(View), Data Entry),
[_THISROW_BEFORE].[N1 PHONE 1]<>[_THISROW_AFTER].[N1 PHONE 1]
)
It doesn't seem like bots have access to the context(view) since they occur server side.
@cjphoto wrote:
It doesn't seem like bots have access to the context(view) since they occur server side.
Correct.
Edit: For other bots, you could try a condition [_THISROW_BEFORE].[N1 PHONE 1]=[_THISROW_AFTER].[N1 PHONE 1], so those will not fire on [N1 PHONE 1] column change.
To prevent change in other view, you could use Editable_if of CONTEXT("View") = " Data Entry view" for the results column or phone column as you want.
Thanks so much Suvrutt for giving me all of these tips. I tried them all but it did not produce the results I was looking for. It turns out my other bots are more than likely the problem so I will attempt to change how I'm using them. Once again, thank you for all of your help.
User | Count |
---|---|
25 | |
15 | |
4 | |
3 | |
3 |