<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Can't delete profile picture in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472218#M129144</link>
    <description>&lt;P&gt;Hey Everyone,&lt;/P&gt;
&lt;P&gt;I opened a HI Ticket and the technician helped me solve the issue.&amp;nbsp; This issue was completely my fault; should not delete profile pictures directly from the sys_attachment table for anyone who's facing the same problem.&amp;nbsp; Here is the solution that fixed it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The below KB article documents how to delete/update user profile pictures:&lt;BR /&gt;&lt;A href="https://hi.service-now.com/kb_view.do?sysparm_article=KB0687598" target="_blank" rel="noopener noreferrer nofollow"&gt;https://hi.service-now.com/kb_view.do?sysparm_article=KB0687598&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The delete should be performed from the live_profile table.&lt;BR /&gt;&lt;BR /&gt;Still using the steps above I was not able to empty the photo field for the corrupt record and I had to run 2 clean up scripts:&lt;BR /&gt;&lt;BR /&gt;Clear photo value in live profile:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;var gr = new GlideRecord('live_profile');&lt;BR /&gt;gr.addQuery('sys_id', '0280fc77dba4d700af88f5861d961971');&lt;BR /&gt;gr.query(); &lt;BR /&gt;while(gr.next()) &lt;BR /&gt;{ &lt;BR /&gt;gs.print("Updating user"+ gr.name);&lt;BR /&gt;gs.print("Actual Photo"+ gr.photo);&lt;BR /&gt;gr.photo = '';&lt;BR /&gt;gr.setWorkflow(false); &lt;BR /&gt;gr.update(); &lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Clear photo value in sys_user:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;var gr = new GlideRecord('sys_user');&lt;BR /&gt;gr.addQuery('sys_id', '62826bf03710200044e0bfc8bcbe5df1');&lt;BR /&gt;gr.query(); &lt;BR /&gt;while(gr.next()) &lt;BR /&gt;{ &lt;BR /&gt;gs.print("Updating user"+ gr.name);&lt;BR /&gt;gs.print("Actual Photo"+ gr.photo);&lt;BR /&gt;gr.photo = '';&lt;BR /&gt;gr.setWorkflow(false); &lt;BR /&gt;gr.update(); &lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;After clearing the cache using cache.do everything was back to order.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2019 13:43:33 GMT</pubDate>
    <dc:creator>yundlu316</dc:creator>
    <dc:date>2019-06-13T13:43:33Z</dc:date>
    <item>
      <title>Can't delete profile picture</title>
      <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472210#M129136</link>
      <description>&lt;P&gt;I'm trying to get a better sense of how the Profile picture works in Service Portal and uploaded a random profile picture, which shows up great:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/165504iDBCCAEFE6EB8B00B/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My issue is when I delete the profile pic from sys_attachment (both the entry that starts with "thumb..." and the ZZ_YYlive_profile), clear my browser cache, and refresh my page, the profile page looks like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/165508iB7DE10C1EE41CB94/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;At first I didn't notice anything wrong with the above screenshot, but after impersonating another user, I noticed that the font awesome user icon is missing from the large avatar, and my initials are missing from the smaller avatar in the header:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/165516i3427AB2EA39073FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When I look inside the console for my profile, I notice that for the large avatar, there's still a sys_id associated with my profile picture even though I've deleted it completely from the sys_attachment table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/165500iD03C43914922E2EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Am I missing a step in this?&amp;nbsp; If a user uploads a picture but then deletes it, how can they get rid of the sys_id that looks to still be rending a "blank" photo?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 22:16:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472210#M129136</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2019-06-12T22:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can't delete profile picture</title>
      <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472211#M129137</link>
      <description>&lt;P&gt;&lt;BR /&gt;1) Navigate to live_profile.list&amp;nbsp;&lt;BR /&gt;2) Search for the User whose photo you want to remove or edit.&amp;nbsp;&lt;BR /&gt;3) Go into the record and click the Delete button under the photo.&amp;nbsp;&lt;BR /&gt;4) Save the record.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sachin&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 22:19:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472211#M129137</guid>
      <dc:creator>sachin_namjoshi</dc:creator>
      <dc:date>2019-06-12T22:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can't delete profile picture</title>
      <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472212#M129138</link>
      <description>&lt;P&gt;Hi Sachin, Thanks for this, but I actually already did this and it's still not working correctly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/165496i20B17E7E9941D46D/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 22:28:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472212#M129138</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2019-06-12T22:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can't delete profile picture</title>
      <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472213#M129139</link>
      <description>&lt;P&gt;did you tried cache.do after deleting profile picture?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sachin&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 22:49:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472213#M129139</guid>
      <dc:creator>sachin_namjoshi</dc:creator>
      <dc:date>2019-06-12T22:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can't delete profile picture</title>
      <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472214#M129140</link>
      <description>&lt;P&gt;yes I did that as well&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 22:52:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472214#M129140</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2019-06-12T22:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can't delete profile picture</title>
      <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472215#M129141</link>
      <description>&lt;P&gt;What can you (as that avatar should be stored in sys_attachment as well) is the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- using Chrome browser right click on the avatar and then Inspect&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- in the inspector you should see something like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2017-03-31 at 3.48.42 PM.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/165506iF3058AA860DE0BB9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2017-03-31 at 3.48.42 PM.png" alt="Screen Shot 2017-03-31 at 3.48.42 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- the sys_id you see there in red is the sys_id to the corresponding record in sys_attachment. Go to sys_attachment.list and in the filter use sys_id is &amp;lt;that sys_id&amp;gt;. This way you should get a record back. Let me know if this shows a record for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sachin&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 23:00:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472215#M129141</guid>
      <dc:creator>sachin_namjoshi</dc:creator>
      <dc:date>2019-06-12T23:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can't delete profile picture</title>
      <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472216#M129142</link>
      <description>&lt;P&gt;Thanks Sachin, but I've tried that as well:&lt;/P&gt;
&lt;P&gt;&amp;lt;div class="sub-avatar mia" ng-style="avatarPicture" style="background-image: url("&lt;STRONG&gt;a110cbb0db823f00d8261b774896193d&lt;/STRONG&gt;.iix"); color: transparent;"&amp;gt;&lt;BR /&gt; &amp;lt;i class="fa fa-user"&amp;gt;&amp;lt;/i&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/165512iD7C135CCD71381F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 23:11:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472216#M129142</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2019-06-12T23:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can't delete profile picture</title>
      <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472217#M129143</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like you to check whether that particular image is deleted from the table where it is stored.&lt;/P&gt;
&lt;P&gt;Could you please check the same and reload the page?&lt;/P&gt;
&lt;P&gt;I hope your issue will be resolved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the answer as correct if it suffice your query.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;BR /&gt;Soumita.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 07:00:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472217#M129143</guid>
      <dc:creator>Soumita3</dc:creator>
      <dc:date>2019-06-13T07:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can't delete profile picture</title>
      <link>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472218#M129144</link>
      <description>&lt;P&gt;Hey Everyone,&lt;/P&gt;
&lt;P&gt;I opened a HI Ticket and the technician helped me solve the issue.&amp;nbsp; This issue was completely my fault; should not delete profile pictures directly from the sys_attachment table for anyone who's facing the same problem.&amp;nbsp; Here is the solution that fixed it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The below KB article documents how to delete/update user profile pictures:&lt;BR /&gt;&lt;A href="https://hi.service-now.com/kb_view.do?sysparm_article=KB0687598" target="_blank" rel="noopener noreferrer nofollow"&gt;https://hi.service-now.com/kb_view.do?sysparm_article=KB0687598&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The delete should be performed from the live_profile table.&lt;BR /&gt;&lt;BR /&gt;Still using the steps above I was not able to empty the photo field for the corrupt record and I had to run 2 clean up scripts:&lt;BR /&gt;&lt;BR /&gt;Clear photo value in live profile:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;var gr = new GlideRecord('live_profile');&lt;BR /&gt;gr.addQuery('sys_id', '0280fc77dba4d700af88f5861d961971');&lt;BR /&gt;gr.query(); &lt;BR /&gt;while(gr.next()) &lt;BR /&gt;{ &lt;BR /&gt;gs.print("Updating user"+ gr.name);&lt;BR /&gt;gs.print("Actual Photo"+ gr.photo);&lt;BR /&gt;gr.photo = '';&lt;BR /&gt;gr.setWorkflow(false); &lt;BR /&gt;gr.update(); &lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Clear photo value in sys_user:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;var gr = new GlideRecord('sys_user');&lt;BR /&gt;gr.addQuery('sys_id', '62826bf03710200044e0bfc8bcbe5df1');&lt;BR /&gt;gr.query(); &lt;BR /&gt;while(gr.next()) &lt;BR /&gt;{ &lt;BR /&gt;gs.print("Updating user"+ gr.name);&lt;BR /&gt;gs.print("Actual Photo"+ gr.photo);&lt;BR /&gt;gr.photo = '';&lt;BR /&gt;gr.setWorkflow(false); &lt;BR /&gt;gr.update(); &lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;After clearing the cache using cache.do everything was back to order.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 13:43:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/can-t-delete-profile-picture/m-p/1472218#M129144</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2019-06-13T13:43:33Z</dc:date>
    </item>
  </channel>
</rss>

