json format postman

Hello everyone,

I have a problem.

I take from database information in format JSON.

I want to take just two variables, one integer and the other ir format JSON.

In the rule and in process, the result is correct:


List of Dictionary: 1 item
Dictionary
         state: "1"
        content:
             "{"dataA":
                     {"sexo":"M","estadoCivil":"C"},
               "dataB":
                      {"accion":"A","numero":"23233223",ECTERERA...}

but I am using Postman, and I call that process and the information is invalid JSON:

          "state": "1",
           "content": "{\"dataA\":{\"sexo\":\"M\",\"estadoCivil\" ECTERERA

Someone knows how can I fix it?

Thank you so much.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    It looks like you're missing the closing curly brace.  I don't know if that's an issue with your copy paste into here, or if that's exactly what the code is returning.

    content: { dataA: {you've got stuff in here with curly braces}, dataB: {you also have curly braces around this} //but where's the closing curly brace for content?

    Try plugging the result into another Appian rule that accepts JSON as an input, or send it to an online JSON formatter.  If I'm right it should fail.  If it does reliably and If the curly brace is missing from what is contained in the database rows, you may want to look into troubleshooting whatever it is writing to the database to fix your problem.  If you can copy from database and paste into online json formatter, and it does work, you'll want to troubleshoot how you're pulling from the DB.

Reply
  • 0
    Certified Lead Developer

    It looks like you're missing the closing curly brace.  I don't know if that's an issue with your copy paste into here, or if that's exactly what the code is returning.

    content: { dataA: {you've got stuff in here with curly braces}, dataB: {you also have curly braces around this} //but where's the closing curly brace for content?

    Try plugging the result into another Appian rule that accepts JSON as an input, or send it to an online JSON formatter.  If I'm right it should fail.  If it does reliably and If the curly brace is missing from what is contained in the database rows, you may want to look into troubleshooting whatever it is writing to the database to fix your problem.  If you can copy from database and paste into online json formatter, and it does work, you'll want to troubleshoot how you're pulling from the DB.

Children
No Data