Options

Line Break when sending data through JSON

iqbalmadiqbalmad Member Posts: 180
Hello,

i am using Microsoft Dynamics NAV 2017 version.

I am sending data through JSON.

Variable: JsonTextWriter
Datatype: DotNet
Subtype: Newtonsoft.Json.JsonTextWriter.'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

JsonTextWriter.WriteValue(TextField1 + '\n' + TextField2 + '\n'+ TextField3);

The output comes in one single line, but i want it to be break and go on another line after each TextField

TextField1
TextField2
TextField3

any suggestions?

Answers

  • lubostlubost Member Posts: 633
    Hello,
    - if all textfields have to be in one node, it is not best decision to separate them by line breaks. Try to use text constant %1\%2\%3 and fill this via STRSUBSTNO function
    - if textfields are separated nodes, you have to follow JSON structure rules (use {"nodename":"TextField1"},{...
Sign In or Register to comment.