```search.createColumn({ name: "formulacu...
# suitescript
v
Copy code
search.createColumn({
         name: "formulacurrency",
         formula: "CASE WHEN {taxitem.iseccode} = 'T' OR {taxitem.isreversecharge} = 'T' THEN ({amount} * 0.21) ELSE {taxamount} END",
         label: "Amount Tax"
      }),
      search.createColumn({
         name: "formulacurrency",
         formula: "CASE WHEN {taxitem.custrecord_nondeductible_parent} IS NULL THEN NULL ELSE (CASE WHEN {taxitem.iseccode} = 'T' OR {taxitem.isreversecharge} = 'T' THEN ({amount} * 0.21) ELSE {taxamount} END) * {taxitem.custrecord_vat_ratio_ndr_p} END",
         label: "NonDeductable_P"
      }),
      search.createColumn({
         name: "formulacurrency",
         formula: "CASE WHEN {taxitem.custrecord_nondeductible_parent} IS NULL THEN NULL ELSE (CASE WHEN {taxitem.iseccode} = 'T' OR {taxitem.isreversecharge} = 'T' THEN ({amount} * 0.21) ELSE {taxamount} END) * {taxitem.custrecord_vat_ratio_ndr_f} END",
         label: "NonDeductable_F"
      }),
I have this code in my saved search. i want to fetch the value of these three formula columns in my map stage. after parsing in map stage, i get only the first formulacurrency column only, not the other two. what could be the reason? as well i want to fetch all the three columns, could anyone please help me how to do that in map stage after parsing?
c
Hi @vennila ramasamy, it is not possible as formula are sharing the same id. You'll have to reach your result by columns using index (getValue(result.columns[x]). It is not optimal but there is no choice.
v
its in the map stage where the context from the input stage is already parsed. so i cannot run the saved search again to get the result.
c
You don't need to rerun your search, you just have to make sure that the value returned from your getInputData is organized the way you need for your map
b
give your columns a more unique name, the most boring example of which is formulacurrency_0, formulacurrency_1, and formulacurrency_2
1000 1
s
Saved search formula fields only have to start with the right prefixes: formulacurrency, formulatext, etc. The rest is up to you, so you can have formulacurrency_amount_tax, or any suffix you want