Load True/False data using Transform Maps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 06:31 AM
I have true/false fields on my excel file . After I loaded the data correctly, I run the transform map and the True/False fields are not being populated. I looked online for scripts to help with this problem and I tried a few scripts but nothing works. On the excel file, the true/false fields are yes/no in excel. This is my script so far and it didn't work,
answer = (function transformEntry(source) {
if (source.u_released == "yes") {
return true;
if (source.u_released == "no") {
return false;
})(source);
u_released is the source field
But on of the resource tells like
"" source released field equals to the string of yes then mark the Boolean in target field as true ""
But i am not sure what it means. i tried various scripts but still it is show as false
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 07:28 AM
No it is not changing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 07:03 AM
Hello Aishwarya,
Did you try like this if not then
You could try something like this:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
var answer = false;
var a = source.u_released;
if (a == "yes") {
answer = true;
}
return answer;
})(source, map, log, target);
You just need to make sure to return the answer.
I hope this will help you.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response useful to you and help others to find information faster.
Thanks,
Tejas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2020 07:30 AM