Skip to main content
January 3, 2024
Question

Data needs to be stored in line by line

  • January 3, 2024
  • 21 replies
  • 1 view

in a paragraph field i will provide input as 

test1

test2

test3

How this data will be stored in db ,is it will be in line by line as separate string or as a single string

    21 replies

    konduruc733182
    January 3, 2024

    Hello sabat0002,

    It is going to save in the same format as a single string. 


    mikes0011
    Brainy
    January 3, 2024

    If you're entering them all into a single text value like from a paragraph field, then unless you do something additional to that text value, it will all be stored together in one text value of whatever database column you write it to.  It's impossible for anyone here to tell you what to do when you don't tell us about what your requirement is, what you're hoping to do with it, etc.  Do you have a more experienced appian developer on your team you could talk about this with?

    Also, once again it's not necessary to make a new thread for every part of the same related subject - this is the third one so far that's related to the same original question, when you could just follow up with other replies on your existing post(s).

    mathieud0001
    Brainy
    January 3, 2024

    If I understood correctly, you want to store these as separate line items in the DB but have them in one paragraph field in the interface?

    sabat0002Author
    January 4, 2024

    yes [mention:f5e81b8502fa4e77ad12697686a4fc56:e9ed411860ed4f2ba0265705b8793d05] 

    konduruc733182
    January 4, 2024

    Hello sabat0002,

    You can try using the below format. But you will have to construct the data for each line value and map your Parent record/data PK here and also try to have a sort/order value using the indexes, so that the text entered is always displayed in the correct order. 

    a!localVariables(
      local!save,
      local!update:if(
        a!isNullOrEmpty(local!save),
        {},
        reject(
          fn!isnull(_),
          split(local!save,"
    ")
        )
      ),
      {
        a!paragraphField(
          label: "Paragraph",
          labelPosition: "ABOVE",
          value: local!save,
          saveInto: local!save,
          refreshAfter: "UNFOCUS",
          height: "MEDIUM",
          validations: {}
        )
      }
    )