I would like to write the formula to create the JSON format .
I am unable to find any documentation for creating the formula to generate the JSON format ,Can you please help me if there is any documentation available.
Actually the requirement is we have 10 column values and one JSON generator column ,Smartsheet should convert those 10 column values into JSON format after entering the respective column attributes.
Can you please give me some clue to sort-out those issue using Smartsheet.
Thanks
Best Answer
-
rama,
So this one may take a bit of work to get set up but once it is functional it may not be too bad. I created a list of six columns and then showed what the JSON would look like when it was done (hopefully I didn't mess up the formatting.
The important thing the remember is that your quotes ( " ) are going to require you to put in a backslash to get it to show up in the cell properly. Here is the formula that I used to get this all to output what is shown.
="'{\"Animal\":\"" + Animal@row + "\", \"Book\":\"" + Book@row + "\", \"Car\":\"" + Car@row + "\", \"Dog\":\"" + Dog@row + "\", \"Earring\":" + Earring@row + ", \"Fish\":\"" + Fish@row + "\"}'"
Resulting in ...
'{"Animal":"Pig", "Book":"The West Wing", "Car":"Mustang", "Dog":"Doodle", "Earring":false, "Fish":"Snapper"}'
Notice that I had to manually type out what would be the column names to get them to show up.
Let me know if this works for you.
Hope this helps!
Heath Hilton
Answers
-
rama,
So this one may take a bit of work to get set up but once it is functional it may not be too bad. I created a list of six columns and then showed what the JSON would look like when it was done (hopefully I didn't mess up the formatting.
The important thing the remember is that your quotes ( " ) are going to require you to put in a backslash to get it to show up in the cell properly. Here is the formula that I used to get this all to output what is shown.
="'{\"Animal\":\"" + Animal@row + "\", \"Book\":\"" + Book@row + "\", \"Car\":\"" + Car@row + "\", \"Dog\":\"" + Dog@row + "\", \"Earring\":" + Earring@row + ", \"Fish\":\"" + Fish@row + "\"}'"
Resulting in ...
'{"Animal":"Pig", "Book":"The West Wing", "Car":"Mustang", "Dog":"Doodle", "Earring":false, "Fish":"Snapper"}'
Notice that I had to manually type out what would be the column names to get them to show up.
Let me know if this works for you.
Hope this helps!
Heath Hilton
-
Thanks its helped me a lot
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.8K Get Help
- 376 Global Discussions
- 207 Industry Talk
- 440 Announcements
- 4.5K Ideas & Feature Requests
- 139 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 284 Events
- 33 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!