{"id":2518,"date":"2019-02-14T11:02:04","date_gmt":"2019-02-14T19:02:04","guid":{"rendered":"https:\/\/developer.microsoft.com\/en-us\/office\/blogs\/?p=2518"},"modified":"2021-10-18T11:17:19","modified_gmt":"2021-10-18T18:17:19","slug":"mvp-article-sharepoint-column-formatting-show-map-in-rich-text-field","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/mvp-article-sharepoint-column-formatting-show-map-in-rich-text-field\/","title":{"rendered":"MVP Article &#8211; SharePoint Column Formatting \u2013 Show Map in Rich Text Field"},"content":{"rendered":"<p>If you haven\u2019t taken a look at the new Column Formatting capabilities in modern SharePoint you are missing out.\u00a0 I wrote a blog post a while back on how to\u00a0<a href=\"https:\/\/www.sharepointsiren.com\/2018\/11\/manually-execute-flow-from-sharepoint\/\" target=\"_blank\" rel=\"noopener noreferrer\">use Column Formatting to manually execute a Flow<\/a>. There are a lot of other similar examples out on Github which you can find here:\u00a0<a href=\"https:\/\/github.com\/SharePoint\/sp-dev-list-formatting\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/SharePoint\/sp-dev-list-formatting.<\/a><\/p>\n<h2>Use Case<\/h2>\n<p>I had a particular use case that I didn\u2019t see an example for on GitHub.\u00a0 I have a SharePoint List which contains a list of Office Locations.\u00a0 In the list is a field called Address which is a multi-line of text field that contains the full address for the location.\u00a0 I want to display the address text and a map of the location above it in my SharePoint view.<\/p>\n<p>While there were some examples of transforming your entire list view and showing a map using Longitude and Latitude points, there were no examples showing how to only apply the formatting to a column with an address.\u00a0 So if you have a similar need then this blog post is for you.<\/p>\n<h2>Column Formatting Basics<\/h2>\n<p>If you\u2019ve used column formatting before you know that to apply it you can click the dropdown next to the column you want to format and select the \u201cFormat Column\u201d option as seen in the screenshot below:<\/p>\n<p><figure id=\"attachment_2534\" aria-labelledby=\"figcaption_attachment_2534\" class=\"wp-caption alignnone\" ><img decoding=\"async\" class=\"size-full wp-image-2534\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic1.png\" alt=\"Figure 1 \u2013 Column Formatting Option Showing in Single Line of Text Field\" width=\"600\" height=\"639\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic1.png 600w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic1-282x300.png 282w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><figcaption id=\"figcaption_attachment_2534\" class=\"wp-caption-text\">Figure 1 \u2013 Column Formatting Option Showing in Single Line of Text Field<\/figcaption><\/figure><\/p>\n<p>You might have noticed, however, that this option is missing for your Multi-line of Text fields as you see here:<\/p>\n<p><figure id=\"attachment_2535\" aria-labelledby=\"figcaption_attachment_2535\" class=\"wp-caption alignnone\" ><img decoding=\"async\" class=\"wp-image-2535 size-full\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic2.png\" alt=\"Figure 2 \u2013 Column Formatting Option Missing in Multi-line of Text Field\" width=\"801\" height=\"320\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic2.png 801w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic2-300x120.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic2-768x307.png 768w\" sizes=\"(max-width: 801px) 100vw, 801px\" \/><figcaption id=\"figcaption_attachment_2535\" class=\"wp-caption-text\">Figure 2 \u2013 Column Formatting Option Missing in Multi-line of Text Field<\/figcaption><\/figure><\/p>\n<p>This doesn\u2019t mean that you can\u2019t apply column formatting to Multi-line of Text fields, you just have to take some extra steps to apply it.<\/p>\n<h2>Getting the Map Set Up<\/h2>\n<p>Before we show how to apply Column Formatting to your multi-line of text field, we need to do some set up so that we can display the map on our list.<\/p>\n<p>For the map functionality, I\u2019m going to be utilizing the Bing Maps API.\u00a0 I like Bing because it\u2019s easy to setup and configure and it\u2019s free to start using.\u00a0 To use the API, you\u2019ll need to create a Bing Maps account and get your API key.\u00a0 You can do that by going to the Bing Maps site:\u00a0\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/bingmaps\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/docs.microsoft.com\/en-us\/bingmaps<\/a><\/p>\n<h2>Applying the Column Formatting<\/h2>\n<p>To get into the screen to apply Column Formatting,\u00a0 click the Gear and List Settings to get into the settings screen:<\/p>\n<p><figure id=\"attachment_2536\" aria-labelledby=\"figcaption_attachment_2536\" class=\"wp-caption alignnone\" ><img decoding=\"async\" class=\"wp-image-2536 size-full\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic3.png\" alt=\"Figure 3 \u2013 List Settings\" width=\"800\" height=\"300\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic3.png 800w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic3-300x113.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic3-768x288.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption id=\"figcaption_attachment_2536\" class=\"wp-caption-text\">Figure 3 \u2013 List Settings<\/figcaption><\/figure><\/p>\n<p>Next, find your multi-line of text field in the list of columns and select it:<\/p>\n<p><figure id=\"attachment_2537\" aria-labelledby=\"figcaption_attachment_2537\" class=\"wp-caption alignnone\" ><img decoding=\"async\" class=\"wp-image-2537 size-full\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic4.png\" alt=\"Figure 4 \u2013 SharePoint List Columns\" width=\"801\" height=\"412\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic4.png 801w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic4-300x154.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic4-768x395.png 768w\" sizes=\"(max-width: 801px) 100vw, 801px\" \/><figcaption id=\"figcaption_attachment_2537\" class=\"wp-caption-text\">Figure 4 \u2013 SharePoint List Columns<\/figcaption><\/figure><\/p>\n<p>Take a look at the column settings and make sure that your column is set to PLAIN TEXT.\u00a0\u00a0<strong><em>Column Formatting will only work correctly on multi-line of text fields if they are set to plain text!<\/em><\/strong><\/p>\n<p><figure id=\"attachment_2538\" aria-labelledby=\"figcaption_attachment_2538\" class=\"wp-caption alignnone\" ><img decoding=\"async\" class=\"wp-image-2538 size-full\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic5.png\" alt=\"Figure 5 \u2013 Ensure Column Settings are Configured Correctly\" width=\"800\" height=\"693\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic5.png 800w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic5-300x260.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic5-768x665.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption id=\"figcaption_attachment_2538\" class=\"wp-caption-text\">Figure 5 \u2013 Ensure Column Settings are Configured Correctly<\/figcaption><\/figure><\/p>\n<p>At the bottom of the screen, you\u2019ll see a text box for Column Formatting.\u00a0 Paste the following block of code into the text box.<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em\">\n<pre style=\"margin: 0;line-height: 125%\">{\n  \"$schema\": <span style=\"color: #a31515\">\"https:\/\/developer.microsoft.com\/json-schemas\/sp\/column-formatting.schema.json\"<\/span>,\n  \"elmType\": <span style=\"color: #a31515\">\"img\"<\/span>,\n  \"attributes\": {\n    \"class\": <span style=\"color: #a31515\">\" ms-borderColor-neutralLighter\"<\/span>,\n    \"src\": <span style=\"color: #a31515\">\"='https:\/\/dev.virtualearth.net\/REST\/v1\/Imagery\/Map\/Road\/'+[$Address]+'?mapSize=280,215&amp;key=[Insert Your Bing Map API Key Here]' \"<\/span>\n  },\n  \"txtContent\": <span style=\"color: #a31515\">\"[$Address]\"<\/span> \n}\n<\/pre>\n<\/div>\n<p>Make sure to input your Bing Maps API key where it says \u201c<em>insert here<\/em>\u201d.\u00a0 If your column name is different than Address, replace the references of that to your column name.<\/p>\n<p>Your screen should look like this after you\u2019ve pasted in the code:<\/p>\n<p><figure id=\"attachment_2539\" aria-labelledby=\"figcaption_attachment_2539\" class=\"wp-caption alignnone\" ><img decoding=\"async\" class=\"wp-image-2539 size-full\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic6.png\" alt=\"Figure 6 \u2013 Insert Code Block Here\" width=\"800\" height=\"613\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic6.png 800w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic6-300x230.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic6-768x588.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption id=\"figcaption_attachment_2539\" class=\"wp-caption-text\">Figure 6 \u2013 Insert Code Block Here<\/figcaption><\/figure><\/p>\n<p>Click OK on this screen and navigate back to your list view to see the results!<\/p>\n<h2>The End Result<\/h2>\n<p><figure id=\"attachment_2540\" aria-labelledby=\"figcaption_attachment_2540\" class=\"wp-caption alignnone\" ><img decoding=\"async\" class=\"size-full wp-image-2540\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic7.png\" alt=\"\" width=\"799\" height=\"598\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic7.png 799w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic7-300x225.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/april-mvp-pic7-768x575.png 768w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><figcaption id=\"figcaption_attachment_2540\" class=\"wp-caption-text\">Figure 7 \u2013 Desired look<\/figcaption><\/figure><\/p>\n<h2>About the Author<\/h2>\n<p><img decoding=\"async\" class=\"alignright wp-image-2519 size-thumbnail\" style=\"float: left;margin: 10px\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/aprilmvp-150x150.jpg\" alt=\"\" width=\"150\" height=\"150\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/aprilmvp-150x150.jpg 150w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/aprilmvp-300x300.jpg 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/aprilmvp-24x24.jpg 24w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/aprilmvp-48x48.jpg 48w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/aprilmvp-96x96.jpg 96w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2019\/02\/aprilmvp.jpg 400w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/p>\n<p style=\"margin: 0cm;margin-bottom: .0001pt\"><a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fwww.twitter.com%2Faprildunnam&amp;data=02%7C01%7CVesa.Juvonen%40microsoft.com%7C3f58724802774db5cd7208d68d153f13%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636851519748392185&amp;sdata=kjbo1Es0%2Ffsrd0%2Bj3bXr4E2LTmNxDmcs%2F2b8mhGPfr8%3D&amp;reserved=0\">April Dunnam<\/a> is a Business Applications MVP and owner of <a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fwww.thrivefast.com&amp;data=02%7C01%7CVesa.Juvonen%40microsoft.com%7C3f58724802774db5cd7208d68d153f13%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636851519748392185&amp;sdata=NIEkKw4STodIY%2FNoNwD7ud5QtSrwUn00eIXwWZdV1xs%3D&amp;reserved=0\">ThriveFast<\/a>.\u00a0 She is a Process Automation Princess, SharePoint Siren, Karaoke Queen. A woman who codes, but teaches others to build apps and automation with zero code.\u00a0 April is president of the Oklahoma PowerApps &amp; Flow User Group and regularly speaks at events across the country.<\/p>\n<p style=\"margin: 0cm;margin-bottom: .0001pt\">April maintains a blog with SharePoint, PowerApps &amp; Flow related topics that you can find at <a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fwww.sharepointsiren.com&amp;data=02%7C01%7CVesa.Juvonen%40microsoft.com%7C3f58724802774db5cd7208d68d153f13%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636851519748392185&amp;sdata=AeYYNmlNzcPBeR0%2F%2BF4dr4SuXMPw312IUfwhNCDJGDc%3D&amp;reserved=0\">https:\/\/www.sharepointsiren.com<\/a>.\u00a0 You can follow her on twitter <a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Ftwitter.com%2Faprildunnam&amp;data=02%7C01%7CVesa.Juvonen%40microsoft.com%7C3f58724802774db5cd7208d68d153f13%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636851519748392185&amp;sdata=hKDjSsrSUwHDhbpICbmBdOTV7fWN%2FDhJ%2B%2FN6%2FY9t7a8%3D&amp;reserved=0\">https:\/\/twitter.com\/aprildunnam<\/a> and find her on GitHub at <a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fgithub.com%2Faprildunnam&amp;data=02%7C01%7CVesa.Juvonen%40microsoft.com%7C3f58724802774db5cd7208d68d153f13%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636851519748392185&amp;sdata=Xg9sER8L26DEKDX8T22C8n09DbfFwbk%2F7UWgiP7tqqw%3D&amp;reserved=0\">https:\/\/github.com\/aprildunnam<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>What is the MVP article series?<\/h2>\n<p>We have <a href=\"https:\/\/developer.microsoft.com\/en-us\/office\/blogs\/opening-sharepoint-dev-blog-for-community-posts\/\">opened up our SharePoint developer blog<\/a> also for the Microsoft MVPs who would like to share their articles around SharePoint development topics also through this channel. All articles written by MVPs are clearly indicated by using the &#8220;MVP article&#8221; prefix in the title of the blog post. If you are an MVP and would like to get some additional exposure, please send your suggestions around the article to <a href=\"mailto:spdevblogcommunity@microsoft.com\"><em class=\"\">spdevblogcommunity@microsoft.com<\/em><\/a>\u00a0email address and we can start a discussion on the suggestion and possible publishing schedule.<\/p>\n<p>You can absolutely also do cross-posting of the article through your own blog, but we would prefer the material which is submitted as a suggestion, to be fresh and new, rather than something which\u00a0has been released months ago. We will use both <a href=\"https:\/\/twitter.com\/sharepoint\"><em>SharePoint<\/em><\/a> and <em><a href=\"https:\/\/twitter.com\/officedev\">OfficeDev<\/a><\/em> social media channels to promote these articles, so it&#8217;s a nice way to get you additional exposure for the community around the work you do.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><i>SharePoint Team, Microsoft &#8211; 14th of February 2019<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MVP Article &#8211; Step by step guidance on how to show a map based on location information in SharePoint lists with a no-code approach using just SharePoint Column Formatting capability. <\/p>\n","protected":false},"author":69078,"featured_media":2541,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[78],"class_list":["post-2518","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-365-developer","tag-data-visualizations"],"acf":[],"blog_post_summary":"<p>MVP Article &#8211; Step by step guidance on how to show a map based on location information in SharePoint lists with a no-code approach using just SharePoint Column Formatting capability. <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/2518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69078"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=2518"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/2518\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/2541"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=2518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=2518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=2518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}