<?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>topic Re: Generate Email When User's Credit Allowance is Low in ArcGIS Connectors for Power Automate Questions</title>
    <link>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679518#M1270</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/95621"&gt;@BobBooth1&lt;/a&gt;&amp;nbsp;and good luck with the project&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/722968"&gt;@bbywaterbw&lt;/a&gt;!&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jan 2026 12:52:24 GMT</pubDate>
    <dc:creator>Annie_K</dc:creator>
    <dc:date>2026-01-23T12:52:24Z</dc:date>
    <item>
      <title>Generate Email When User's Credit Allowance is Low</title>
      <link>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679309#M1263</link>
      <description>&lt;P&gt;I have a several notebooks running that will fail when the user has 29 credits remaining. I believe this is the Esri default, because I cannot find a way around this even if the notebook uses a fraction of a credit.&lt;/P&gt;&lt;P&gt;My solution would be to generate an email to myself or another admin when a user has a low credit balance. Is this a possible trigger to set in Power Automate?&lt;/P&gt;&lt;P&gt;My only other approach would be to use a notebook to scrape user credit information on a regular basis and add that to a table that would in turn trigger a 'When a Feature Class is Added' response from Power Automate. This seems a bit clunky and obviously uses more credits in the process.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jan 2026 15:57:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679309#M1263</guid>
      <dc:creator>bbywaterbw</dc:creator>
      <dc:date>2026-01-22T15:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Email When User's Credit Allowance is Low</title>
      <link>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679318#M1265</link>
      <description>&lt;P&gt;You're correct that's a built-in failsafe in ArcGIS Online that you can't change. You might try something like the following:&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Connect to your ArcGIS Online organization&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;using the ArcGIS API for Python.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Get the organization’s credit balance&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;credits&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;property.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Set a threshold&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(e.g., 50 credits).&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Check the balance&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and compare it to the threshold.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Send an email alert&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;using Python’s&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;smtplib&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(or another email service API like SendGrid, Outlook, Gmail).&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Schedule the notebook&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to run periodically (ArcGIS Online Notebooks can be scheduled if you have Advanced Notebooks enabled, or you can run it locally via a cron job/Task Scheduler).&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 22 Jan 2026 16:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679318#M1265</guid>
      <dc:creator>Annie_K</dc:creator>
      <dc:date>2026-01-22T16:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Email When User's Credit Allowance is Low</title>
      <link>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679413#M1267</link>
      <description>&lt;P&gt;I have some code that checks the credit balance for an account I use for Notebook automation that I want to keep topped up with credits.&lt;/P&gt;&lt;P&gt;I run it on a VM, but you could also set it up to run periodically on your personal machine, or some other machine that's available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
import smtplib
from email.message import EmailMessage

reportPage = ''

# Connect to the GIS 
myGIS = GIS(url="https://myAGOorg.maps.arcgis.com/", username='MYADMINUSERNAME', password="MYPASSWORD")
theUserAccount = myGIS.users.get(username='THEUSERNAME_HERE')

cm = myGIS.admin.credits
credit_status = "User has " + str(theUserAccount.availableCredits) + " credits."

if theUserAccount.availableCredits &amp;lt; 50:
    cm.allocate(theUserAccount, 1000)
    reportPage = reportPage + '\n' + "Allocated 1000 Credits"



# SMTP method:

SENDER = 'userName@myCompany.com'
RECIPIENTS = ['userName@myCompany.com']
MESSAGE_SUBJECT = 'Automated Report User Credits'

MESSAGE_BODY = """
User Credits Status:

{}

""".format(reportPage)

smtpserver = smtplib.SMTP("smtp.myCompany.com")
#smtpserver.login(SMTP_USER, SMTP_PASSWORD)

msg = EmailMessage()
msg.set_content(MESSAGE_BODY)
msg['Subject'] = MESSAGE_SUBJECT
msg['from'] = SENDER
msg['to'] = RECIPIENTS

try:
    smtpserver.send_message(msg)
except smtplib.SMTPException as err:
    print("Unable to send mail:", err)
finally:
    smtpserver.quit()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; This one sends out a notice via email using SMTP, but you can also send messages from the ArcGIS Org if you're an admin.&amp;nbsp; If you wanted you could skip the automatic topping off and just send a message that the account is low.&lt;/P&gt;&lt;P&gt;This is an example showing how to send from the org:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;um = myGIS.users
uMiniList = []
uMiniList.append(myGISusername)

user = um.get(theUserName)
subject = 'Credits Low'
message = f'''Hi, {myGISusername},
Your credits are low. 
'''
um.send_notification(uMiniList,subject,message,type='email')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think Notebooks will let you send emails via SMTP, but they should allow you to send notifications from the org.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jan 2026 19:45:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679413#M1267</guid>
      <dc:creator>BobBooth1</dc:creator>
      <dc:date>2026-01-22T19:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Email When User's Credit Allowance is Low</title>
      <link>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679415#M1268</link>
      <description>&lt;P&gt;This tutorial shows the steps for setting up a batch file and Windows Scheduled Task to run a Python script.&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.arcgis.com/en/projects/schedule-automated-near-real-time-data-updates/" target="_blank"&gt;https://learn.arcgis.com/en/projects/schedule-automated-near-real-time-data-updates/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jan 2026 19:46:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679415#M1268</guid>
      <dc:creator>BobBooth1</dc:creator>
      <dc:date>2026-01-22T19:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Email When User's Credit Allowance is Low</title>
      <link>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679431#M1269</link>
      <description>&lt;P&gt;Thank you both for the replies - I will try to implement one or both of these suggestions and report back with any successes!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jan 2026 20:39:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679431#M1269</guid>
      <dc:creator>bbywaterbw</dc:creator>
      <dc:date>2026-01-22T20:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Email When User's Credit Allowance is Low</title>
      <link>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679518#M1270</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/95621"&gt;@BobBooth1&lt;/a&gt;&amp;nbsp;and good luck with the project&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/722968"&gt;@bbywaterbw&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jan 2026 12:52:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-connectors-for-power-automate-questions/generate-email-when-user-s-credit-allowance-is-low/m-p/1679518#M1270</guid>
      <dc:creator>Annie_K</dc:creator>
      <dc:date>2026-01-23T12:52:24Z</dc:date>
    </item>
  </channel>
</rss>

