• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How to create valid JSON using webapp list layout?

Community Beginner ,
Jul 26, 2012 Jul 26, 2012

Copy link to clipboard

Copied

Good Morning Everyone,

I tried to create JSON using webapp list layout. My list layout looks like:

{"item_logoagenzia":"{tag_logo agenzia_value}", "item_description":"{tag_description, 100}"}
It works fine but as soon as some one use special chars like double quotes etc. The JSON stop working and become invalid. Please also see my thread at stackoverflow where I gave me javascript code as well. If any one can help on this issue he will find me thankful to him.
Regards,
TOPICS
Web apps

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 27, 2012 Jul 27, 2012

That only renders the characters, that is the nature of using the ,100 not JSON problem either. Make a multiline custom field if you want a chunk of text and wrap it in your own p.

Issues your showing are not JSON format, just way things work.

Votes

Translate

Translate
LEGEND ,
Jul 27, 2012 Jul 27, 2012

Copy link to clipboard

Copied

That is just scripting.

You either have to regexp to break out or you use " ' so if quotes are inside then you use single outside.

Take when you set the HTML of an element in jquery as an example...

$(".something").html('<div Id="thisid"><\div>'):

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 27, 2012 Jul 27, 2012

Copy link to clipboard

Copied

Thanks Liam but the problem is not only with double qoutes if some one input a paragraph tag webapp's descriptiong area ... {tag_description, 100} renders it as linebreak and it also cuased to make JSON invalid.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 27, 2012 Jul 27, 2012

Copy link to clipboard

Copied

LATEST

That only renders the characters, that is the nature of using the ,100 not JSON problem either. Make a multiline custom field if you want a chunk of text and wrap it in your own p.

Issues your showing are not JSON format, just way things work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines