{"id":1331482,"date":"2021-08-20T11:32:52","date_gmt":"2021-08-20T18:32:52","guid":{"rendered":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1331482"},"modified":"2021-08-20T12:07:55","modified_gmt":"2021-08-20T19:07:55","slug":"converting-a-csv-with-photos-to-a-layer-with-attachments","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments","title":{"rendered":"Converting a CSV with photos to a layer with attachments"},"author":266402,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[22941],"tags":[759832,555752,42641,462082,24341],"industry":[],"product":[36841,760042,36551],"class_list":["post-1331482","blog","type-blog","status-publish","format-standard","hentry","category-mapping","tag-arcgis-instant-apps","tag-arcgis-notebooks","tag-arcgis-online","tag-attachment-viewer","tag-python","product-api-python","product-instant-apps","product-arcgis-online"],"acf":{"short_description":"This blog walks you through creating a layer with attachments from a CSV with linked images using\u00a0an\u00a0astronaut data CSV\u00a0as\u00a0an\u00a0example.\u00a0","flexible_content":[{"acf_fc_layout":"content","content":"<p><span data-contrast=\"auto\">There is an incredible amount of data out there that&#8217;s stored in CSVs with images stored as links. Currently, there is no simple way to create a layer from a CSV and mass download and attach the linked images to it. Why would you want to do this? The <\/span><a href=\"https:\/\/webapps.maps.arcgis.com\/home\/item.html?id=65dd2fa3369649529b2c5939333977a1\"><span data-contrast=\"none\">Attachment Viewer Instant App<\/span><\/a><span data-contrast=\"auto\">\u00a0is a beautiful way to display images while still viewing the geospatial\u00a0data but\u00a0can only be used\u00a0for layers with\u00a0attachments.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">This\u00a0method\u00a0outlined below uses a short python script in the ArcGIS notebook to\u00a0fill the gap.\u00a0The script includes a function that downloads and attaches images to the right location in one step.\u00a0This blog walks you through creating a layer with attachments from a CSV with linked images using\u00a0an\u00a0<\/span><a href=\"https:\/\/query.wikidata.org\/#%23Birthplaces%20of%20astronauts%0A%23%20select%20all%20astronauts%20with%20name%2C%20image%2C%20birthdate%2C%20birthplace%20and%20coordinates%20of%20the%20birthplace%0A%0ASELECT%20%3Fastronaut%20%3FastronautLabel%20%3Fimage%20%3Fbirthdate%20%3Fbirthplace%20%3Fcoord%20WHERE%20%7B%0A%20%20%3Fastronaut%20%3Fx1%20wd%3AQ11631%3B%0A%20%20wdt%3AP18%20%3Fimage%3B%0A%20%20wdt%3AP569%20%3Fbirthdate%3B%0A%20%20wdt%3AP19%20%3Fbirthplace.%0A%20%0A%20%20%3Fbirthplace%20wdt%3AP625%20%3Fcoord%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%0A%7D%0AORDER%20BY%20DESC%28%3Fbirthdate%29\"><span data-contrast=\"none\">astronaut data CSV<\/span><\/a><span data-contrast=\"auto\">\u00a0as\u00a0an\u00a0example.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><strong>Setting up your Environment<\/strong><\/h2>\n"},{"acf_fc_layout":"sidebar","content":"<p><span data-contrast=\"auto\">A few import lines are necessary before we start. These lines import the modules we will be using to manipulate the\u00a0feature\u00a0layers (the GIS module) and edit data frames (the\u00a0pandas\u00a0module).<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"from arcgis.gis import GIS\r\nimport pandas as pd\r\ngis = GIS(\"home\")","spotlight_name":"","section_title":"","position":"Right","spotlight_image":false},{"acf_fc_layout":"content","content":"<h2><strong>Adding your CSV<\/strong><\/h2>\n<p><span data-contrast=\"auto\">First, you need to add\u00a0the\u00a0CSV\u00a0file\u00a0to your\u00a0files in the notebook. This can be done simply through the notebook by clicking on\u00a0<\/span><i><span data-contrast=\"auto\">File<\/span><\/i><span data-contrast=\"auto\">\u00a0in the top toolbar and uploading the CSV to\u00a0the\u00a0<\/span><i><span data-contrast=\"auto\">home<\/span><\/i><span data-contrast=\"auto\">\u00a0folder. From here we want to add the CSV to our notebook by clicking the little plus next to\u00a0it\u2019s\u00a0name.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><b><span data-contrast=\"auto\">Creating\u00a0your Layer<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">The easiest way to create a layer from a CSV is through the\u00a0<\/span><i><span data-contrast=\"auto\">My Content\u00a0<\/span><\/i><span data-contrast=\"auto\">Page. Once in\u00a0<\/span><i><span data-contrast=\"auto\">My Content<\/span><\/i><span data-contrast=\"auto\">\u00a0click on\u00a0<\/span><i><span data-contrast=\"auto\">add item\u00a0<\/span><\/i><span data-contrast=\"auto\">and upload\u00a0the\u00a0CSV making sure to select \u201cAdd CSV and create a hosted\u00a0feature\u00a0layer.\u201d<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Once the layer is published you need to add it to your notebook. <\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><b><span data-contrast=\"auto\">Adding your Layer to the Notebook<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">To add the\u00a0layer\u00a0click on\u00a0<\/span><i><span data-contrast=\"auto\">Add<\/span><\/i><span data-contrast=\"auto\">\u00a0in the top toolbar, find the layer in\u00a0<\/span><i><span data-contrast=\"auto\">My Content<\/span><\/i><span data-contrast=\"auto\">\u00a0and click the plus next to it to add it to the notebook.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n"},{"acf_fc_layout":"sidebar","content":"<p><span class=\"TextRun SCXW61677256 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW61677256 BCX0\">From here the notebook should look something\u00a0like this:\u00a0<\/span><\/span><span class=\"EOP SCXW61677256 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"from arcgis.gis import GIS\r\nimport pandas as pd\r\ngis = GIS(\"home\")\r\ndataset = '\/arcgis\/home\/AstronautBirths.csv'\r\n# Item Added From Toolbar\r\n# Title: Astronaut Birth Locations | Type: Feature Service | Owner: lydia_wma\r\nitem = gis.content.get(\"5bb2104af5814b96a5468346ee2555ec\")","spotlight_name":"","section_title":"","position":"Right","spotlight_image":false},{"acf_fc_layout":"content","content":"<h2><strong><span class=\"TextRun MacChromeBold SCXW243171203 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW243171203 BCX0\">Downloading and Attaching Linked Images<\/span><\/span><\/strong><\/h2>\n"},{"acf_fc_layout":"sidebar","content":"<p><span class=\"TextRun SCXW239269587 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW239269587 BCX0\">Here comes the fun part! The function definition below mass downloads and attaches the images to the right locations in the layer.\u00a0<\/span><span class=\"NormalTextRun SCXW239269587 BCX0\">It\u00a0<\/span><span class=\"NormalTextRun SCXW239269587 BCX0\">enables attachments and then\u00a0<\/span><span class=\"NormalTextRun SCXW239269587 BCX0\">works as a loop to open each image\u00a0<\/span><span class=\"NormalTextRun SpellingErrorV2 SCXW239269587 BCX0\">url<\/span><span class=\"NormalTextRun SCXW239269587 BCX0\">, check if\u00a0<\/span><span class=\"NormalTextRun SCXW239269587 BCX0\">it&#8217;s<\/span><span class=\"NormalTextRun SCXW239269587 BCX0\">\u00a0valid, and attach it to the location if it is.\u00a0<\/span><span class=\"NormalTextRun SCXW239269587 BCX0\">Copy and paste it into your\u00a0<\/span><span class=\"NormalTextRun SCXW239269587 BCX0\">notebook!<\/span><\/span><span class=\"EOP SCXW239269587 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"def download_attach(csv_path, photo_column, feature_layer):    \r\n    import pandas as pd\r\n    import requests\r\n    import shutil\r\n    headers = {'User-Agent': 'Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/50.0.2661.102 Safari\/537.36'}\r\n    feature_layer = feature_layer.layers[0]\r\n    mgr = feature_layer.manager\r\n    mgr.update_definition({\"hasAttachments\": True})\r\n    index = 0\r\n    path_to_data = csv_path\r\n    data = pd.read_csv(path_to_data)\r\n    data = data.dropna(subset=[photo_column])\r\n    for row in data[photo_column]:\r\n        index += 1\r\n        imgURL = row\r\n        file_name = imgURL.split('\/')[-1]\r\n        r = requests.get(imgURL, stream = True, headers = headers)\r\n        if r.status_code == 200:\r\n            r.raw.decode_content = True            \r\n            with open(file_name, 'wb') as f:\r\n                shutil.copyfileobj(r.raw, f)\r\n            #add attachment: attachment is file_name\r\n            feature_layer.attachments.add(index, file_name)\r\n        else:\r\n            print('invalid link')\r\n    return \"done\"","spotlight_name":"","section_title":"","position":"Right","spotlight_image":false},{"acf_fc_layout":"sidebar","content":"<p><span class=\"TextRun SCXW41346150 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW41346150 BCX0\">After the function definition you will need to call the function to perform the attachments. You can do so using the code below.<\/span><\/span><span class=\"EOP SCXW41346150 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"download_attach(csv_path, photo_column, feature_layer)\r\n","spotlight_name":"","section_title":"","position":"Right","spotlight_image":false},{"acf_fc_layout":"sidebar","content":"<p><span data-contrast=\"auto\">In the Astronaut CSV, photo_link is the name of the column in the CSV that contains the links. Make sure that the column name is in quotes because it is a string!<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>As an example, my function call looks like this:<\/p>\n","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"download_attach(dataset, \u201cphoto_link\u201d, item)","spotlight_name":"","section_title":"","position":"Right","spotlight_image":false},{"acf_fc_layout":"content","content":"<p><span data-contrast=\"auto\">In the Astronaut CSV I&#8217;m using\u00a0photo_link\u00a0is the name of the column in the CSV that contains the links. Make sure\u00a0that\u00a0the column name is in quotes because it is a string!<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><b><span data-contrast=\"auto\">Running the Notebook<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">To run the notebook simply click the\u00a0<\/span><i><span data-contrast=\"auto\">run\u00a0<\/span><\/i><span data-contrast=\"auto\">button in the top toolbar until all the cells have been run! You will know it finished running when the\u00a0asterisk\u00a0* turns into a number in the box at the left of each cell.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">To ensure everything\u00a0was added\u00a0properly,\u00a0open the published feature layer\u2019s attribute table in a new map and verify images are attached to the correct\u00a0locations.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><b><span data-contrast=\"auto\">Final Steps<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">From here you are ready to create your map and app!<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Once you have\u00a0verified\u00a0the process above worked properly and attachments are added to the correct layer,\u00a0you\u2019re\u00a0ready to make your map and symbolize\u00a0locations\u00a0appropriately.\u00a0If you would like to visualize only\u00a0locations\u00a0with attachments, you will need to create a new field in the Classic Map Viewer and calculate the field using the following arcade expression:<\/span><b><i><span data-contrast=\"auto\">\u00a0Count(Attachments($feature))\u00a0<\/span><\/i><\/b><span data-contrast=\"auto\">which will create a field with the number of attachments for each\u00a0location. From there you can filter the layer to show only\u00a0locations\u00a0where that field does not equal zero\u00a0\u2013 locations that don\u2019t have zero attachments.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Afterwards you can make an Attachment Viewer Instant App to\u00a0highlight\u00a0the attachments and geospatial\u00a0information. See the following blog\u00a0for more help on creating the app:\u00a0<\/span><a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/build-an-attachment-viewer-app-with-express-setup\/\"><span data-contrast=\"none\">Build an Attachment Viewer App with Express Setup<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><span class=\"TextRun SCXW137947252 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW137947252 BCX0\">Click\u00a0<\/span><\/span><a class=\"Hyperlink SCXW137947252 BCX0\" href=\"https:\/\/webapps.maps.arcgis.com\/apps\/instant\/attachmentviewer\/index.html?appid=eb335e7a96544434ba65b5cabc85032a\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW137947252 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW137947252 BCX0\" data-ccp-charstyle=\"Hyperlink\">here<\/span><\/span><\/a><span class=\"TextRun SCXW137947252 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW137947252 BCX0\">\u00a0to see the final Attachment Viewer App showing only items with attachments!<\/span><\/span><span class=\"EOP SCXW137947252 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n"},{"acf_fc_layout":"image","image":{"ID":1331982,"id":1331982,"title":"Screen Shot 2021-08-20 at 3.05.42 PM","filename":"Screen-Shot-2021-08-20-at-3.05.42-PM.png","filesize":858268,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/Screen-Shot-2021-08-20-at-3.05.42-PM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments\/screen-shot-2021-08-20-at-3-05-42-pm","alt":"A Attachment Viewer Instant App opened to Astronaut Thomas Stafford and his birthplace","author":"266402","description":"","caption":"","name":"screen-shot-2021-08-20-at-3-05-42-pm","status":"inherit","uploaded_to":1331482,"date":"2021-08-20 19:06:24","modified":"2021-08-20 19:07:29","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":2880,"height":1638,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/Screen-Shot-2021-08-20-at-3.05.42-PM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/Screen-Shot-2021-08-20-at-3.05.42-PM.png","medium-width":459,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/Screen-Shot-2021-08-20-at-3.05.42-PM.png","medium_large-width":768,"medium_large-height":437,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/Screen-Shot-2021-08-20-at-3.05.42-PM.png","large-width":1899,"large-height":1080,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/Screen-Shot-2021-08-20-at-3.05.42-PM-1536x874.png","1536x1536-width":1536,"1536x1536-height":874,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/Screen-Shot-2021-08-20-at-3.05.42-PM-2048x1165.png","2048x2048-width":2048,"2048x2048-height":1165,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/Screen-Shot-2021-08-20-at-3.05.42-PM-818x465.png","card_image-width":818,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/Screen-Shot-2021-08-20-at-3.05.42-PM-1899x1080.png","wide_image-width":1899,"wide_image-height":1080}},"image_position":"center","orientation":"horizontal","hyperlink":""}],"authors":[{"ID":266402,"user_firstname":"Lydia","user_lastname":"Troup","nickname":"Lydia Troup","user_nicename":"ltroup","display_name":"Lydia Troup","user_email":"ltroup@esri.com","user_url":"","user_registered":"2021-08-19 14:41:58","user_description":"Lydia is a Solution Engineer supporting nonprofits and global organizations.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/06\/TeamsPhoto-2-213x200.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"},{"ID":6111,"user_firstname":"Ian","user_lastname":"Wittenmyer","nickname":"Ian Wittenmyer","user_nicename":"ianwittenmyer","display_name":"Ian Wittenmyer","user_email":"iwittenmyer@esri.com","user_url":"https:\/\/www.arcgis.com","user_registered":"2018-03-02 00:17:59","user_description":"Product Engineer for ArcGIS Online and Configurable App Templates","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2019\/04\/IanWittenmyer-150x150.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"related_articles":"","card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/1920px-Bruce_McCandless_II_during_EVA_in_1984.png","wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/spcae.png"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Converting a CSV with photos to a layer with attachments<\/title>\n<meta name=\"description\" content=\"This blog walks you through creating a layer with attachments from a CSV with linked images using\u00a0an\u00a0astronaut data CSV\u00a0as\u00a0an\u00a0example.\u00a0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Converting a CSV with photos to a layer with attachments\" \/>\n<meta property=\"og:description\" content=\"This blog walks you through creating a layer with attachments from a CSV with linked images using\u00a0an\u00a0astronaut data CSV\u00a0as\u00a0an\u00a0example.\u00a0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-20T19:07:55+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments\"},\"author\":{\"name\":\"Lydia Troup\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/6596199c85d8dcec73d9795d70278baf\"},\"headline\":\"Converting a CSV with photos to a layer with attachments\",\"datePublished\":\"2021-08-20T18:32:52+00:00\",\"dateModified\":\"2021-08-20T19:07:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments\"},\"wordCount\":10,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"ArcGIS Instant Apps\",\"ArcGIS Notebooks\",\"ArcGIS Online\",\"attachment viewer\",\"python\"],\"articleSection\":[\"Mapping\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments\",\"name\":\"Converting a CSV with photos to a layer with attachments\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2021-08-20T18:32:52+00:00\",\"dateModified\":\"2021-08-20T19:07:55+00:00\",\"description\":\"This blog walks you through creating a layer with attachments from a CSV with linked images using\u00a0an\u00a0astronaut data CSV\u00a0as\u00a0an\u00a0example.\u00a0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Converting a CSV with photos to a layer with attachments\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/6596199c85d8dcec73d9795d70278baf\",\"name\":\"Lydia Troup\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/06\/TeamsPhoto-2-213x200.jpg\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/06\/TeamsPhoto-2-213x200.jpg\",\"caption\":\"Lydia Troup\"},\"description\":\"Lydia is a Solution Engineer supporting nonprofits and global organizations.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/lydia-troup-842b1a1b4\"],\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/ltroup\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Converting a CSV with photos to a layer with attachments","description":"This blog walks you through creating a layer with attachments from a CSV with linked images using\u00a0an\u00a0astronaut data CSV\u00a0as\u00a0an\u00a0example.\u00a0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments","og_locale":"en_US","og_type":"article","og_title":"Converting a CSV with photos to a layer with attachments","og_description":"This blog walks you through creating a layer with attachments from a CSV with linked images using\u00a0an\u00a0astronaut data CSV\u00a0as\u00a0an\u00a0example.\u00a0","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2021-08-20T19:07:55+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments"},"author":{"name":"Lydia Troup","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/6596199c85d8dcec73d9795d70278baf"},"headline":"Converting a CSV with photos to a layer with attachments","datePublished":"2021-08-20T18:32:52+00:00","dateModified":"2021-08-20T19:07:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments"},"wordCount":10,"commentCount":0,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["ArcGIS Instant Apps","ArcGIS Notebooks","ArcGIS Online","attachment viewer","python"],"articleSection":["Mapping"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments","name":"Converting a CSV with photos to a layer with attachments","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2021-08-20T18:32:52+00:00","dateModified":"2021-08-20T19:07:55+00:00","description":"This blog walks you through creating a layer with attachments from a CSV with linked images using\u00a0an\u00a0astronaut data CSV\u00a0as\u00a0an\u00a0example.\u00a0","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Converting a CSV with photos to a layer with attachments"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/6596199c85d8dcec73d9795d70278baf","name":"Lydia Troup","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/06\/TeamsPhoto-2-213x200.jpg","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/06\/TeamsPhoto-2-213x200.jpg","caption":"Lydia Troup"},"description":"Lydia is a Solution Engineer supporting nonprofits and global organizations.","sameAs":["https:\/\/www.linkedin.com\/in\/lydia-troup-842b1a1b4"],"url":"https:\/\/www.esri.com\/arcgis-blog\/author\/ltroup"}]}},"text_date":"August 20, 2021","author_name":"Multiple Authors","author_page":"https:\/\/www.esri.com\/arcgis-blog\/products\/instant-apps\/mapping\/converting-a-csv-with-photos-to-a-layer-with-attachments","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/08\/spcae.png","primary_product":"ArcGIS Instant Apps","tag_data":[{"term_id":759832,"name":"ArcGIS Instant Apps","slug":"arcgis-instant-apps","term_group":0,"term_taxonomy_id":759832,"taxonomy":"post_tag","description":"","parent":0,"count":51,"filter":"raw"},{"term_id":555752,"name":"ArcGIS Notebooks","slug":"arcgis-notebooks","term_group":0,"term_taxonomy_id":555752,"taxonomy":"post_tag","description":"","parent":0,"count":38,"filter":"raw"},{"term_id":42641,"name":"ArcGIS Online","slug":"arcgis-online","term_group":0,"term_taxonomy_id":42641,"taxonomy":"post_tag","description":"","parent":0,"count":420,"filter":"raw"},{"term_id":462082,"name":"attachment viewer","slug":"attachment-viewer","term_group":0,"term_taxonomy_id":462082,"taxonomy":"post_tag","description":"","parent":0,"count":4,"filter":"raw"},{"term_id":24341,"name":"python","slug":"python","term_group":0,"term_taxonomy_id":24341,"taxonomy":"post_tag","description":"","parent":0,"count":171,"filter":"raw"}],"category_data":[{"term_id":22941,"name":"Mapping","slug":"mapping","term_group":0,"term_taxonomy_id":22941,"taxonomy":"category","description":"","parent":0,"count":2692,"filter":"raw"}],"product_data":[{"term_id":36841,"name":"ArcGIS API for Python","slug":"api-python","term_group":0,"term_taxonomy_id":36841,"taxonomy":"product","description":"","parent":36601,"count":151,"filter":"raw"},{"term_id":760042,"name":"ArcGIS Instant Apps","slug":"instant-apps","term_group":0,"term_taxonomy_id":760042,"taxonomy":"product","description":"","parent":36591,"count":112,"filter":"raw"},{"term_id":36551,"name":"ArcGIS Online","slug":"arcgis-online","term_group":0,"term_taxonomy_id":36551,"taxonomy":"product","description":"","parent":0,"count":2429,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=instant-apps","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/1331482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/266402"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=1331482"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/1331482\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=1331482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=1331482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=1331482"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=1331482"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=1331482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}