Jitterbit Formula Builder - Case inside IF?

715 views Asked by At

I was wondering if you can use the 'case' function within an If statement in the Jitterbit formula builder?

We have 2 different source fields mapped to a target field in salesforce. Im using the case to say if a particular set of characters are found in the source field, map a result in the target.

Im doing this via case, however only the false condition is creating a result.

Is there a way to use case in an if, and if not is there an alternative?

Formula:

<trans>
$DESC51 = DESC51;
$SOLDBY = SOLDBY;
$IndexAtFC = Index($DESC51,"FC");
$IndexAtPE = Index($DESC51,"PE");
$IndexAtGR = Index($DESC51,"GR");
$IndexAtE2 = Index($SOLDBY,"E2");
$IndexAtTZ = Index($SOLDBY,"TZ");
$IndexAtINTERNET = Index($SOLDBY,"INTERNET");
$IndexAtTQUATER = Index($SOLDBY,"TQUATER");

$Telephone = "Telephone";
$ParkEndBoxOffice = "Park End Box Office";
$GoodisonRoadBoxOffice = "Goodison Road Box Office";
$EvertonTwo = "Everton Two";
$TicketZone = "Ticket Zone";
$Internet = "Internet";
$TicketQuater = "Ticket Quater";
$NULLValue = '';

If($DESC51 = Case($IndexAtFC == 0, $Telephone, 
$IndexAtPE == 0, $ParkEndBoxOffice,
$IndexAtGR == 0, $GoodisonRoadBoxOffice), $DESC51,

$SOLDBY = Case($IndexAtE2 == 0, $EvertonTwo, 
$IndexATTZ == 0, $TicketZone,
$IndexATINTERNET == 0, $Internet,
$IndexATTQUATER == 0, $TicketQuater, true, $NULLValue))
</trans>
1

There are 1 answers

0
mtom On

Change line with

If($DESC51 = Case($IndexAtFC == 0, $Telephone,

to read

If($DESC51 == Case($IndexAtFC == 0, $Telephone,

That is, use the "==" comparison operator rather that and the "=" assignment operator here