How to determine that choice field value had been ignored?

LizaS
Tera Contributor

In my import set, I'm transforming the incoming data using Field Maps.

For some choice fields, I have defined the ignore choice action.

In a Transform Script, I want to check if an incoming value was ignored and send a dedicated response to the client that triggered the API.

I think I can achieve it by comparing the source's value to the target's value in an OnAfter script.

For example,

 

if (!target.u_status && source.u_status)

 

However, since I have multiple fields where I defined the action, I want to avoid comparing the values directly.

Is there some event or property that I can check in a Transform Script to determine whether a value was ignored? 

 

5 REPLIES 5

GlideFather
Tera Patron

 

Navigate to your Transform map, select a desired field and there is this option "Choice option":
> Ignore
> Create
> Reject

Screenshot 2024-11-13 at 08.29.56.png



EDIT: do you want to apply the same logics ALWAYS or under specific conditions?
If Always, the above configuration shall be enough, 
If Conditioned, the script to be adjusted, for example "ignore = true;"

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Hey, thank you for your reply.

I have already done that.

I aim to notify the client that triggered the import set API that a value has been ignored.

To achieve that, I try to understand if there's a way to know that a value was ignored.

Hmmmmm. Maybe it can be caused by the script being onAfter, which mean AFTER the operation happened... for this, try to adjust it in the onBefore - change the whole script or separate it into two matching the needs

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


What do you mean by "it can be caused by the script being onAfter"?

Currently, I don't have any scripts.

I use Field Maps.

I want to create a script (I don't care about each kind) that checks that a value was ignored and logs/alters the response sent to the client.

I don't want to check all choice fields explicitly.