Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Value Mapping to Boolean field

SOLVED
Go to solution
Highlighted
Iceman_1
Super Collector

Value Mapping to Boolean field

Hello all,

I'm working on a data exchange task and I'm unable to setup value mapping to a boolean field. Specifically, I would like the incoming value of "Y" mapped to Yes in the boolean field, and "NULL" to No. If value mapping is out of the question, what are some of the other recommend way of doing so?
4 REPLIES
Chris Bailey_3
Honored Contributor

Re: Value Mapping to Boolean field

Hello,

Unfortunately, value mapping isn't an option on a boolean field as you've probably already noticed. When importing a boolean, 0 is mapped to "No", and "1" is equal to "Yes" by default, so if you have the option to change the values that are being passed in, that will work.

Otherwise, you'd probably need to look at plugging in an intermediate script that modifies the value of the field before you run the import.

Thanks,
Chris
Chris Bailey_3
Honored Contributor
Solution

Re: Value Mapping to Boolean field

Hi,

Sorry, one more option just occurred to me as I was pushing the "Submit" button. You could import your values from the external system into a custom text field and then you could use a DB rule to populate your boolean field based on the value in the text field.

I would NOT really recommend this as it's sort of sloppy, and changing the source data or integration seems better. However, if you're looking for a quick 'n dirty option, it might fit the bill.

Thanks,
Chris
Iceman_1
Super Collector

Re: Value Mapping to Boolean field

Thanks Chris,

I found a different way of doing it. The configuration files can be modified and decoded the incoming data. See below example: where Y = 1, N = 0, and the '0' at the end is the default value.

decode([POWERSUPPLY].[BATTERYBACKUP],'Y','1','N','0','0')

The only other thing I have to detail with is instead of bringing the value in as a number, I bought it in as a character, as Data Exchange tend to bring in a decimal place with the numerial value.
Iceman_1
Super Collector

Re: Value Mapping to Boolean field

Configuration File can decode / change the context of the incoming data.
//Add this to "OnDomLoad" event