Sum of 2 variables or databank values

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in SOAtest
Sum 2 (or more) values of 2 variables or Data Bank values
I have a value that comes from a databank, its name is "Databank1:ValueA".
I have a second value that comes from a second databank, its name is "Databank2:ValueB"

I need to add these 2 values to be sent as a parameter in a XML File.

How can I do this?

Thanks in advance
Tagged:

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    edited November 2016
    Hello eugenia,

    I'd be happy to help you with this issue.

    The best way to overcome this issue will be to write a script that will add two data source (in this case, both of which are data banks) values and return their sum for use as a parameter.

    Hope this helps! Let me know if there are any additional questions...

    Regards,
    Adam
  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Hello eugenia,

    I just wanted to follow up with you on this forum topic.

    Has this issue been resolved?

    Regards,
    Adam
  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Hi Adam,

    Thanks for your response.
    What I finish doing is this


    var SOAPUtil = Packages.soaptest.api.SOAPUtil

    function AddTwoValues(input, context) {
    var strValueA = context.getDataSourceValueAsString("Databank1: ValueA")
    var strValueB = context.getDataSourceValueAsString("Databank2: ValueB")
    var result = parseInt(strValueA) + parseInt(strValueB)

    return SOAPUtil.getXMLFromString([result.toString()])
    }

    Hello eugenia,

    I just wanted to follow up with you on this forum topic.

    Has this issue been resolved?

    Regards,
    Adam

  • LegacyForumLegacyForum Posts: 1,669 ✭✭

    Hi Adam,

    Thanks for your response.
    What I finish doing is this


    var SOAPUtil = Packages.soaptest.api.SOAPUtil

    function AddTwoValues(input, context) {
    var strValueA = context.getDataSourceValueAsString("Databank1: ValueA")
    var strValueB = context.getDataSourceValueAsString("Databank2: ValueB")
    var result = parseInt(strValueA) + parseInt(strValueB)

    return SOAPUtil.getXMLFromString([result.toString()])
    }


    Hello eugenia,

    I just wanted to follow up with you on this forum topic.

    Has this issue been resolved?

    Regards,
    Adam

    Hey eugenia,

    Great! Glad everything worked out.

    Let me know if anything else comes up...

    Regards,
    Adam
Sign In or Register to comment.