Skip to Content
author's profile photo Former Member
Former Member

Graphical mapping not workig for IF else

Hi,

I have two fields A and B in source side and i have to map it to C in the destination side depending on the condition.

The condition is If there is any value in B then map B to C otherwise map A to C.

Here A is mandatory B is optional and C is mandatory fields.

I mapped it like: if B exists then --> pass this to IF else --> if true map B ; in else condition A to C.

My problem is if I have any value in B it is working fine. But if I don’t have anything in B then C should get value from A. But this is not happening.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Dec 20, 2007 at 09:50 PM

    Add another condtion comparing B with empty string..!! Though B does not have value.. if the node exists.. it would map that!!

    VJ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 20, 2007 at 10:46 PM

    An empty tag will still map

    You could create a UDF with two inputs A and B

    Test the value of B and if it exists then output B to C else output A to C

    Add some code like

    if(b.equals(null) || b.equals(“”))

    return a;

    else

    return b;

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 21, 2007 at 03:38 AM

    The problem is tht in all the cases, the node B exists. When u send the value, then B holds the value, otherwise it is an empty field. So u may put another condition checking for tht.

    Regards,

    Prateek

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.