API Express Condition Component

Hello,

I am attempting to use the Condition Component with the following flow as depicted in the screen shot below:

SQL Component which returns Boolean parameter
Condition Component with two branches
Then two SQL Components which are executed based on the condition

Everything works for the most part with the following exception. The two SQL Components prior to the mapping return 46 parameters. It works fine if I do not map all the parameters. The problem does not appear to be related to a particular parameter but rather the number of parameters. The only thing I can think of is that the number of parameters is exceeding the code length due to "JavaScript code length is restricted to 1000 characters".

Is there a way to check the javascript code length?

The result of the SQL query is an array with 1 object. Is it possible to pass the object in whole in the final mapping vs mapping the individual parameters? (if the issue is due to the code length exceeding limit due to number of parameters mapped)

When attempting to save the service with all the paramters mapped is an error is displayed

Error
This wasn't supposed to happen but an error occurred. Please try again. If the error persists please let us know on the http://appery.io/forum or email us: support@appery.io

If I remove some parameters is saves and works fine.

thank you

1 person has
this question
+1
Reply
  • 1
    I think I got it working, though some clarification on the generated code for the mapping would be helpful.

    the generated code from mapping the array generates the following code:

    var result = AE.EntityAPI("result", AE_MODEL);
    if (BODY["true"]) {
    for (var i = 0, l = BODY["true"].length; i < l; i++) {
    result[i] = AE.EntityAPI("result.i", AE_MODEL);
    }
    }
    if (BODY["else"]) {
    for (var i = 0, l = BODY["else"].length; i < l; i++) {
    result[i] = AE.EntityAPI("result.i", AE_MODEL);
    }
    }


    Mapping all the parameters exceeds the "JavaScript code length is restricted to 1000 characters"

    The following code seems to work just fine in returning the data.
    if (BODY["else"]) {
    result = BODY["else"];
    }
    if (BODY.true) {
    result = BODY["true"];
    }


    what I would like to know what is
    AE.EntityAPI("result", AE_MODEL);

    thanks
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Hi, Jeffrey:

    I have been trying for a long time to display object but failed.
    may you share how do you put Mapping result template ?

    I use the following. Because that is the way it allow me to choose object [i]

    My Mapping result template, but not working.
    {"result":[{}]}
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited