There is an amount field that contains zeros. Would like to set a Constraint where Value not equal to 0. Is this possible to do?
What would your end result look like, having the xml element empty instead of containing a "0" or something else? Is this in a Map or what is the scenario?
We were looking for a way to suppress any record amount that contains a zero.
outVal = null;
outVal = recordVal;
Where recordVal is the input parameter and outVal is the output parameter from the custom scripting function.
Thank you - this is very helpful We want to disregard from the whole document.
Denise, then I would go with a simply decision shape or a Business Rule if that is more suited for your scenario, set the profile element as the first value in the shape and then for example a logic of "not equal" and the second value as a static "0".
Denise, have you tried this? Did it solve your problem?
Hi Erik - We did try using a decision shape but we are seeing more than records with '0' getting suppressed. Here's what the process is doing:
There's a Web services connector retrieving the data and then a map step which is manipulating the data/formatting. The output is a flat file.
We then have a Decision shape. If flat file element 'Amount' field is not equal to '0' we load that record. The Amount field value is '0.000000' and have tried using the static value in the decision shape as '0' and '0.000000'.
So the output of the Mapping to the Flat file is "0.000000"? Is this retrieved purely from the web service or is it part of any map function that transforms the Ammount value in any way? How is your flat file setup when it comes to the "Data Format Option" for that value in the flat file? If it is set as "Character", have you tried setting it to Number with implied decimals "0" and then having the static value of "0" to check against in the decision shape?
Thanks Erik - The data looks so much better! The amount field was still set to character in the flat file. The customer wants the six digits after the decimal. What should we be using in the implied decimal field?
You can see this link for an overview of the possibilities to find what is best suited for your scenario (Number DataType).
But for your scenario, how is the data looking that is coming through now after you made the change to Number?
If your indata have more than 6 decimals, and you want it to be 6 decimals you can use a pattern of "###.######", to indicate this. Or are you meaning that your indata holds for example "1.1" and you would want it to have "1.100000"?
Hi Erik - The indata amounts will always have 6 decimals. i.e. the customer wants this amount from indata 6133.660000 to be saved to the flat file we are creating.
I did try the pattern you suggested, and the zeros are still loading..here's what the numbers looks like loading to the flat file:
What should be used for implied decimals? We are using 6.
Are you referring to, by "zeros are still loading", that you get the "0" in the third column of the second flat file? And you do not want "0" there at all? Or do you mean the zeros for the "-25627310000"?
I think that you should have implied decimals set to "0". Is this the indata that you get from the web service: "
What would you like the output to look like then?
Consider the following pattern as well: "#.000000"
In this situation you don't want to use implied decimals. You should use the number format suggested by Erik to always force six decimal places: "#.000000"
Implied decimals is generally used by legacy mainframe systems that don't support a decimal point and therefore assume the rightmost N digits should be considered decimals. In your case you DO have an explicit decimal point and just want to output a specific level of decimal places.
Thank you both for your input. I did try using the number format "#.000000", but still see the 0 amount coming through to the flat file:
Non-zero numbers are correct:
I cannot clear implied decimal field - it defaults back to 0 each time.
Question: What's the value of outVal if the test condition is false?
Don't you need
outVal = inValue
Darrell, yes ofcourse, missed that (and updated my last reply)...
I asked because I'm a Boomi noob and there is a lot of Boomi tribal knowledgeI just wanted to make sure that there wasn't some implied automatic mapping of input to output if no specific assignment was made.
Hmmm, I originally misread constraint as constant .. sorry for the confusion.
Retrieving data ...