<?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: export to email in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2542457#M990126</link>
    <description>&lt;P&gt;Hi Amrit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, it is possible to restrict input email to a particular domain like "@abcd.com" in ServiceNow. One way to do this is by using a client script in the form of a script include.&lt;/P&gt;&lt;P&gt;Here's an example script that you can use to achieve this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Define the allowed email domain
var allowedDomain = "@abcd.com";

// Get the email field element
var emailField = g_form.getControl('email_field_name');

// Get the value of the email field
var emailValue = emailField.value;

// Check if the email is valid and belongs to the allowed domain
if (emailValue &amp;amp;&amp;amp; emailValue.indexOf('@') &amp;gt; -1 &amp;amp;&amp;amp; emailValue.split('@')[1] !== allowedDomain) {
  alert('Email must belong to ' + allowedDomain);
  emailField.value = '';
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can replace 'email_field_name' with the actual name of the email field in your form. This script will check if the email entered in the field belongs to the allowed domain. If it doesn't, it will show an alert message and clear the email field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Rahul Kumar&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 04:50:08 GMT</pubDate>
    <dc:creator>Rahul Kumar17</dc:creator>
    <dc:date>2023-04-24T04:50:08Z</dc:date>
    <item>
      <title>export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2535167#M987239</link>
      <description>&lt;P&gt;I have a requirement to disable this popup. Even if the export data exceeds a defined limit the system should not allow email export. Rather it should restrict the user from exporting it with a message that export limit has been exceeded&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amrit4_0-1681501860011.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/254655i6FF788313199F7FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amrit4_0-1681501860011.png" alt="Amrit4_0-1681501860011.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me with this&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 19:50:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2535167#M987239</guid>
      <dc:creator>Amrit4</dc:creator>
      <dc:date>2023-04-14T19:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2535189#M987254</link>
      <description>&lt;P&gt;Hi Amrit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To disable the popup that appears when a user tries to export data that exceeds a defined limit in ServiceNow, and instead restrict the user from exporting with a message that the export limit has been exceeded, you can create a Business Rule with the following script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Disable email export when the data limit is exceeded&lt;BR /&gt;// Define the data limit and the error message&lt;BR /&gt;var dataLimit = 5000; // Change this to your desired limit&lt;BR /&gt;var errorMessage = "Export limit exceeded. Please narrow your search criteria and try again.";&lt;/P&gt;&lt;P&gt;// Get the request type and the number of records to be exported&lt;BR /&gt;var requestType = current.sys_class_name;&lt;BR /&gt;var recordCount = 0;&lt;BR /&gt;if (requestType == "sys_report" || requestType == "sys_script_include") {&lt;BR /&gt;// For reports and script includes, get the number of rows from the preview&lt;BR /&gt;var rows = parseInt(g_request.getParameter("sysparm_preview_row_count"));&lt;BR /&gt;if (rows &amp;gt; 0) {&lt;BR /&gt;recordCount = rows;&lt;BR /&gt;}&lt;BR /&gt;} else {&lt;BR /&gt;// For other tables, get the number of records in the result set&lt;BR /&gt;recordCount = current.getRowCount();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Check if the data limit is exceeded&lt;BR /&gt;if (recordCount &amp;gt; dataLimit) {&lt;BR /&gt;// Set the error message and prevent the export&lt;BR /&gt;current.setAbortAction(true);&lt;BR /&gt;current.setReturn("Export limit exceeded. " + recordCount + " records selected. Limit is " + dataLimit + " records.");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This script will run before the export action is executed, check if the number of records to be exported exceeds the defined limit, and if it does, it will set an error message and prevent the export. The user will see the error message and will not be able to export the data until they narrow their search criteria to stay within the export limit.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Rahul Kumar&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 20:24:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2535189#M987254</guid>
      <dc:creator>Rahul Kumar17</dc:creator>
      <dc:date>2023-04-14T20:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2537263#M988147</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/431042"&gt;@Rahul Kumar17&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for this reply but it doesn't work for me. Could you kindly give a little bit for more details on what type of BR i have to push in?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 07:35:03 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2537263#M988147</guid>
      <dc:creator>Amrit4</dc:creator>
      <dc:date>2023-04-18T07:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2537606#M988299</link>
      <description>&lt;P&gt;Hi Amrit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To implement this code, follow these steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Navigate to the "Business Rules" module in ServiceNow.&lt;/LI&gt;&lt;LI&gt;Click "New" to create a new business rule.&lt;/LI&gt;&lt;LI&gt;Enter a name for the business rule, such as "Export Limit Business Rule".&lt;/LI&gt;&lt;LI&gt;Set the "Table" field to the table where the export action is located.&lt;/LI&gt;&lt;LI&gt;In the "Advanced" section, check the "Before" checkbox and set the "When" field to "update".&lt;/LI&gt;&lt;LI&gt;In the "Script" field, copy and paste the code you provided.&lt;/LI&gt;&lt;LI&gt;Modify the "dataLimit" variable to your desired limit.&lt;/LI&gt;&lt;LI&gt;Modify the "errorMessage" variable to your desired message.&lt;/LI&gt;&lt;LI&gt;Save the business rule.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rahul Kumar&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 11:32:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2537606#M988299</guid>
      <dc:creator>Rahul Kumar17</dc:creator>
      <dc:date>2023-04-18T11:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2537640#M988320</link>
      <description>&lt;P&gt;didn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amrit4_0-1681818752435.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/255195i2A9F36B71A352EB9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amrit4_0-1681818752435.png" alt="Amrit4_0-1681818752435.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amrit4_1-1681818790456.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/255196i71553A8113847C58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amrit4_1-1681818790456.png" alt="Amrit4_1-1681818790456.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 11:53:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2537640#M988320</guid>
      <dc:creator>Amrit4</dc:creator>
      <dc:date>2023-04-18T11:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2537939#M988436</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The suggestion of a BR won't work, actually defining a BR as suggested proved that.&amp;nbsp; The Export Limit feature is defined here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/utah-platform-administration/page/administer/exporting-data/concept/c_ExportLimits.html" target="_blank" rel="noopener"&gt;https://docs.servicenow.com/bundle/utah-platform-administration/page/administer/exporting-data/concept/c_ExportLimits.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And for some tables, there are UI actions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;https://[instance_name].service-now.com/sys_ui_action_list.do?sysparm_query=GOTOnameLIKEexport&amp;amp;sysparm_view=&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no idea how you would enforce export limits in general without changing the related system property for the export type. Define those in the documentation if they don't exist in the sys_properties table to override the default value in the documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mayby other Community members can comment on disabling the email choice when exporting data. You may propose that capability, see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.servicenow.com/en-US/bundle/utah-it-business-management/page/product/innovation-management/concept/idea-portal.html" target="_blank"&gt;https://docs.servicenow.com/en-US/bundle/utah-it-business-management/page/product/innovation-management/concept/idea-portal.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 21:27:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2537939#M988436</guid>
      <dc:creator>Bert_c1</dc:creator>
      <dc:date>2023-04-18T21:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2538759#M988770</link>
      <description>&lt;P&gt;Thanks for your response&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/416342"&gt;@Bert_c1&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/431042"&gt;@Rahul Kumar17&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way we can restrict this input email to only a particular domain like "@abcd.com" instead of all types of domain&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 11:54:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2538759#M988770</guid>
      <dc:creator>Amrit4</dc:creator>
      <dc:date>2023-04-19T11:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2539113#M988924</link>
      <description>&lt;P&gt;Hi Amrit4,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe that feature is designed to prevent a session timeout when exporting a "large" amount of data.&amp;nbsp; The user session is subject to the Transaction Quota Rule named 'UI Transactions', which is 298 seconds OOB. The export transaction can fail if that time limit is exceeded. To avoid that, the export can be done in the background and a email notification sent once it is done.&amp;nbsp; And I expect the attachment can exceed some email-related limit and for that, the email delivery would fail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not work email configuration in the instance. There may be some 'System Notification' or 'System Policy' related to email that can do what you want, but you'll need to read the related documentation or maybe some Community member has a suggestion.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 14:55:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2539113#M988924</guid>
      <dc:creator>Bert_c1</dc:creator>
      <dc:date>2023-04-19T14:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2542457#M990126</link>
      <description>&lt;P&gt;Hi Amrit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, it is possible to restrict input email to a particular domain like "@abcd.com" in ServiceNow. One way to do this is by using a client script in the form of a script include.&lt;/P&gt;&lt;P&gt;Here's an example script that you can use to achieve this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Define the allowed email domain
var allowedDomain = "@abcd.com";

// Get the email field element
var emailField = g_form.getControl('email_field_name');

// Get the value of the email field
var emailValue = emailField.value;

// Check if the email is valid and belongs to the allowed domain
if (emailValue &amp;amp;&amp;amp; emailValue.indexOf('@') &amp;gt; -1 &amp;amp;&amp;amp; emailValue.split('@')[1] !== allowedDomain) {
  alert('Email must belong to ' + allowedDomain);
  emailField.value = '';
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can replace 'email_field_name' with the actual name of the email field in your form. This script will check if the email entered in the field belongs to the allowed domain. If it doesn't, it will show an alert message and clear the email field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Rahul Kumar&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 04:50:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2542457#M990126</guid>
      <dc:creator>Rahul Kumar17</dc:creator>
      <dc:date>2023-04-24T04:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: export to email</title>
      <link>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2545572#M991305</link>
      <description>&lt;P&gt;Thanks a ton for your answer&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/431042"&gt;@Rahul Kumar17&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However i want this to happen while we try to export a large data table and it asks for an email there. Below screenshot is for your reference:&lt;/P&gt;&lt;P&gt;Will it work here?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amrit4_0-1682504754193.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/257086i24BA7439AAA2C3CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amrit4_0-1682504754193.png" alt="Amrit4_0-1682504754193.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;</description>
      <pubDate>Wed, 26 Apr 2023 10:26:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/export-to-email/m-p/2545572#M991305</guid>
      <dc:creator>Amrit4</dc:creator>
      <dc:date>2023-04-26T10:26:33Z</dc:date>
    </item>
  </channel>
</rss>

