ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

Why did Khan ask Admiral James T. Kirk about Project Genesis?

Numbers Decrease while Letters Increase

Is "The life is beautiful" incorrect or just very non-idiomatic?

Improving Performance of an XY Monte Carlo

Why is 1. d4 Nf6 2. c4 e6 3. Bg5 almost never played?

What is the difference between "Grippe" and "Männergrippe"?

Could George I (of Great Britain) speak English?

Nothing like a good ol' game of ModTen

Localization at a multiplicative set is a localization at a prime ideal if local

Why is 7 Bd3 in the Cambridge Springs QGD more often met with 7...Ne4 than 7...dxc4?

Why is the UK so keen to remove the "backstop" when their leadership seems to think that no border will be needed in Northern Ireland?

Why is there so little discussion / research on the philosophy of precision?

Is there any way white can win?

Where was Carl Sagan working on a plan to detonate a nuke on the Moon? Where was he applying when he leaked it?

Why are non-collision-resistant hash functions considered insecure for signing self-generated information

Uri tokenizer as a simple state machine

How do thermal tapes transfer heat despite their low thermal conductivity?

Round towards zero

Why do banks “park” their money at the European Central Bank?

Read file lines into shell line separated by space

Are the players on the same team as the DM?

Can I get temporary health insurance while moving to the US?

How do I, an introvert, communicate to my friend and only colleague, an extrovert, that I want to spend my scheduled breaks without them?

How do you harvest carrots in creative mode?



ParseJSON using SSJS


Using AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I am unable to extract msg from the JSON response. @returnCode works fine and I am passing it to SSJS, but then I cannot get the msg value.



<script runat="server" language="javascript">
Platform.Load("Core","1");
var jsonresponse = Variable.GetValue("@response");
var json = Platform.Function.ParseJSON(jsonresponse.msg);
Write("<br>message: " + msg);
</script>


Here's my json for reference:




"msg":"success","date":"2019-08-12","explanation":"xxxxxxx"




Any idea what is wrong with above?










share|improve this question
































    2















    I am unable to extract msg from the JSON response. @returnCode works fine and I am passing it to SSJS, but then I cannot get the msg value.



    <script runat="server" language="javascript">
    Platform.Load("Core","1");
    var jsonresponse = Variable.GetValue("@response");
    var json = Platform.Function.ParseJSON(jsonresponse.msg);
    Write("<br>message: " + msg);
    </script>


    Here's my json for reference:




    "msg":"success","date":"2019-08-12","explanation":"xxxxxxx"




    Any idea what is wrong with above?










    share|improve this question




























      2












      2








      2


      1






      I am unable to extract msg from the JSON response. @returnCode works fine and I am passing it to SSJS, but then I cannot get the msg value.



      <script runat="server" language="javascript">
      Platform.Load("Core","1");
      var jsonresponse = Variable.GetValue("@response");
      var json = Platform.Function.ParseJSON(jsonresponse.msg);
      Write("<br>message: " + msg);
      </script>


      Here's my json for reference:




      "msg":"success","date":"2019-08-12","explanation":"xxxxxxx"




      Any idea what is wrong with above?










      share|improve this question
















      I am unable to extract msg from the JSON response. @returnCode works fine and I am passing it to SSJS, but then I cannot get the msg value.



      <script runat="server" language="javascript">
      Platform.Load("Core","1");
      var jsonresponse = Variable.GetValue("@response");
      var json = Platform.Function.ParseJSON(jsonresponse.msg);
      Write("<br>message: " + msg);
      </script>


      Here's my json for reference:




      "msg":"success","date":"2019-08-12","explanation":"xxxxxxx"




      Any idea what is wrong with above?







      marketing-cloud ssjs






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 12 at 13:15







      CodeRage

















      asked Aug 12 at 13:00









      CodeRageCodeRage

      1,0282 silver badges18 bronze badges




      1,0282 silver badges18 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          5















          You don't have any variable named msg.
          Try this:



          <script runat="server" language="javascript">
          Platform.Load("Core","1");
          var jsonresponse = Variable.GetValue("@response");
          var json = Platform.Function.ParseJSON(jsonresponse);
          Write("<br>message: " + json.msg);
          </script>





          share|improve this answer

























          • oh wow, that was simple - thanks!!

            – CodeRage
            Aug 12 at 13:14













          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "459"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f273260%2fparsejson-using-ssjs%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5















          You don't have any variable named msg.
          Try this:



          <script runat="server" language="javascript">
          Platform.Load("Core","1");
          var jsonresponse = Variable.GetValue("@response");
          var json = Platform.Function.ParseJSON(jsonresponse);
          Write("<br>message: " + json.msg);
          </script>





          share|improve this answer

























          • oh wow, that was simple - thanks!!

            – CodeRage
            Aug 12 at 13:14















          5















          You don't have any variable named msg.
          Try this:



          <script runat="server" language="javascript">
          Platform.Load("Core","1");
          var jsonresponse = Variable.GetValue("@response");
          var json = Platform.Function.ParseJSON(jsonresponse);
          Write("<br>message: " + json.msg);
          </script>





          share|improve this answer

























          • oh wow, that was simple - thanks!!

            – CodeRage
            Aug 12 at 13:14













          5














          5










          5









          You don't have any variable named msg.
          Try this:



          <script runat="server" language="javascript">
          Platform.Load("Core","1");
          var jsonresponse = Variable.GetValue("@response");
          var json = Platform.Function.ParseJSON(jsonresponse);
          Write("<br>message: " + json.msg);
          </script>





          share|improve this answer













          You don't have any variable named msg.
          Try this:



          <script runat="server" language="javascript">
          Platform.Load("Core","1");
          var jsonresponse = Variable.GetValue("@response");
          var json = Platform.Function.ParseJSON(jsonresponse);
          Write("<br>message: " + json.msg);
          </script>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 12 at 13:12









          user3274635user3274635

          3471 silver badge12 bronze badges




          3471 silver badge12 bronze badges















          • oh wow, that was simple - thanks!!

            – CodeRage
            Aug 12 at 13:14

















          • oh wow, that was simple - thanks!!

            – CodeRage
            Aug 12 at 13:14
















          oh wow, that was simple - thanks!!

          – CodeRage
          Aug 12 at 13:14





          oh wow, that was simple - thanks!!

          – CodeRage
          Aug 12 at 13:14

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Salesforce Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f273260%2fparsejson-using-ssjs%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

          Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

          Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림