Method Community

 

JSON Encode the Item Description

Last post 10-12-2020 10:10 PM by Method_Inderdeep. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-11-2020 10:27 AM

    JSON Encode the Item Description

    Hello.

    I have an html input for an item description. 

    The item description will be sent via JSON request to shopify.

    However, the item description has multiple lines, which break the JSON format.

    How can I remove the new lines or encode them? such as \n

  • 10-12-2020 10:10 PM In reply to

    Re: JSON Encode the Item Description

    Hi bryanfromcleveland,


    If you are using this on the screens in Method, then you can use one of our action which is called Character Function Action.

    The Character functions action provides a way to manipulate and parse text.

    In each function, there are parameters to specify the source of the text. Since text can be stored in a variety of different places within Method, a dropdown is provided to locate where the text is stored. This can range from text being manually typed in, to text being stored in action results or controls on screen.

    You can read about it more here.

    Find in JSON action is part of the Character Function action and  something you are looking for.

    Hope this helps!

    -Inder

Page 1 of 1 (2 items)