<?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: ArcGIS Pro Model Builder Help in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106027#M46485</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10036"&gt;@MichaelVolz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't sure how to produce the results of a true or false on the count.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Oct 2021 17:45:53 GMT</pubDate>
    <dc:creator>ABishop</dc:creator>
    <dc:date>2021-10-08T17:45:53Z</dc:date>
    <item>
      <title>ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1105939#M46476</link>
      <description>&lt;P&gt;I am hoping somebody can help me with this...&lt;/P&gt;&lt;P&gt;I am working in ArcGIS Pro 2.8.2.&amp;nbsp; I want to build a model to get the counts on two different sets of data (one being a feature class in SDE and the other being a shapefile), then compare those two counts and if they match, do nothing, if they don't match send me an email so I can check out the issue.&lt;/P&gt;&lt;P&gt;So far I have the following model started.&amp;nbsp; Any help or direction on this would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="model.PNG" style="width: 711px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/24848i0E642781DFB8DAEC/image-size/large?v=v2&amp;amp;px=999" role="button" title="model.PNG" alt="model.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:55:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1105939#M46476</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-10-08T14:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106019#M46482</link>
      <description>&lt;P&gt;I have never E-mailed using a model, but if you export it out to a python script I might be able to assist you.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 17:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106019#M46482</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2021-10-08T17:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106021#M46483</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10036"&gt;@MichaelVolz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See python code I exported from the model below:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2021-10-08 13:32:05
"""
import arcpy
def #  NOT  IMPLEMENTED# Function Body not implemented

def Model():  # Model

    # To allow overwriting outputs change overwriteOutput option to True.
    arcpy.env.overwriteOutput = False

    COMM_SALES_shp = "K:\\GIS_UPDATE\\DATA\\SHP\\COMM_SALES.shp"
    mcpagis_DBO_Commercial_Sales = "C:\\Users\\abishop\\AppData\\Roaming\\Esri\\ArcGISPro\\Favorites\\arcgis2.sde\\mcpagis.DBO.Commercial_Sales"

    # Process: Get Count (Get Count) (management)
    Row_Count = arcpy.management.GetCount(in_rows=COMM_SALES_shp)[0]

    # Process: Get Count (2) (Get Count) (management)
    Row_Count_2_ = arcpy.management.GetCount(in_rows=mcpagis_DBO_Commercial_Sales)[0]

    # Process: If Row Count Is (If Row Count Is) ()
    True_8, False_9 = #  NOT  IMPLEMENTED(in_layer_or_view=COMM_SALES_shp, count_condition="IS_EQUAL_TO", count=Row_Count_2_, count_min=0, count_max=0)

if __name__ == '__main__':
    # Global Environment settings
    with arcpy.EnvManager(scratchWorkspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp11548\80112cea-b9f4-4735-a8b9-66ed0fbbbacf\Default.gdb", workspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp11548\80112cea-b9f4-4735-a8b9-66ed0fbbbacf\Default.gdb"):
        Model()&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Oct 2021 17:34:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106021#M46483</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-10-08T17:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106024#M46484</link>
      <description>&lt;P&gt;Thanks for the code.&amp;nbsp; Does the model currently provide you with the expected results and now you just want to add the ability to have it generate an E-mail to you if the counts are different?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 17:39:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106024#M46484</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2021-10-08T17:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106027#M46485</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10036"&gt;@MichaelVolz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't sure how to produce the results of a true or false on the count.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 17:45:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106027#M46485</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-10-08T17:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106033#M46489</link>
      <description>&lt;P&gt;I would try the following code at line 23:&lt;/P&gt;&lt;P&gt;if Row_Count&amp;lt;&amp;gt; Row_Count_2_:&lt;/P&gt;&lt;P&gt;for now just print out a statement that the values are not equal&lt;/P&gt;&lt;P&gt;Also lets check if&amp;nbsp;Row_Count&amp;nbsp; and Row_Count_2_ are providing legit results with some print statements.&lt;/P&gt;&lt;P&gt;After this is done, we can move onto the E-mail code.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 18:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106033#M46489</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2021-10-08T18:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106039#M46491</link>
      <description>&lt;P&gt;I did what you said and also added print statements.&amp;nbsp; I get a syntax error for the Row_Count &amp;lt;&amp;gt; Row_Count_2.&amp;nbsp; See python code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2021-10-08 14:05:30
"""
import arcpy

def Model():  # Model

    # To allow overwriting outputs change overwriteOutput option to True.
    arcpy.env.overwriteOutput = False

    COMM_SALES_shp = "K:\\GIS_UPDATE\\DATA\\SHP\\COMM_SALES.shp"
    mcpagis_DBO_Commercial_Sales = "C:\\Users\\abishop\\AppData\\Roaming\\Esri\\ArcGISPro\\Favorites\\arcgis2.sde\\mcpagis.DBO.Commercial_Sales"

    # Process: Get Count (Get Count) (management)
    Row_Count = arcpy.management.GetCount(in_rows=COMM_SALES_shp)[0]
    print("in_rows")

    # Process: Get Count (2) (Get Count) (management)
    Row_Count_2_ = arcpy.management.GetCount(in_rows=mcpagis_DBO_Commercial_Sales)[0]
    print("in_rows")

    # Process: If Row Count Is (If Row Count Is) ()
    If Row_Count &amp;lt;&amp;gt; Row_Count_2_:
        print("row counts are not equal")

if __name__ == '__main__':
    # Global Environment settings
    with arcpy.EnvManager(scratchWorkspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp11548\80112cea-b9f4-4735-a8b9-66ed0fbbbacf\Default.gdb", workspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp11548\80112cea-b9f4-4735-a8b9-66ed0fbbbacf\Default.gdb"):
        Model()&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Oct 2021 18:13:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106039#M46491</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-10-08T18:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106045#M46492</link>
      <description>&lt;P&gt;I think &amp;lt;&amp;gt; might be deprecated at the Pro version of python as I am much more familiar with the older ArcMap version of python.&lt;/P&gt;&lt;P&gt;Try != instead and see if that corrects the error.&lt;/P&gt;&lt;P&gt;I would also print the actual Row_Count values to make sure the value is what you expect.&amp;nbsp; Remember to convert numeric value to a string.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 18:22:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106045#M46492</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2021-10-08T18:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106052#M46493</link>
      <description>&lt;P&gt;I'm not that good at python programming.&amp;nbsp; I understand some of it and I am also able automate workflow processes using geoprocessing tools and models.&amp;nbsp; Would you mind helping me by editing the code I provided you with your suggested edits?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 18:31:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106052#M46493</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-10-08T18:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Model Builder Help</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106132#M46508</link>
      <description>&lt;P&gt;Thank you to&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10036"&gt;@MichaelVolz&lt;/a&gt;&amp;nbsp;for assisting me with this!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case anyone reads this thread later and wants to know the final code that worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy,ssl,smtplib

def send_mail(message=None):
    port = ENTER YOUR PORT HERE
    smtp_server = "ENTER YOUR SERVER URL HERE"
    sender_email ="ENTER SENDER EMAIL HERE"
    receiver_email = "ENTER RECEIVER EMAIL HERE"
    password = "ENTER PASSWORD FOR EMAIL HERE"

    context = ssl.create_default_context()
    with smtplib.SMTP(smtp_server, port) as server:
        server.starttls(context=context)
        server.login(sender_email, password)
        server.sendmail(sender_email, receiver_email, message)

#Set geoprocessing environments
arcpy.env.workspace = r"ENTER YOUR WORKSPACE PATH HERE"

# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = True

DATA_VARIABLE_1 = "ENTER YOUR DATA PATH HERE"
DATA_VARIONBLE_2 = "ENTER YOUR DATA PATH HERE"

# Process: Get Count (Get Count) (management)
Row_Count = arcpy.management.GetCount(in_rows=DATA_VARIABLE_1)[0]
print(str(Row_Count))

# Process: Get Count (2) (Get Count) (management)
Row_Count_2_ = arcpy.management.GetCount(in_rows=DATA_VARIABLE_2)[0]
print(str(Row_Count_2_))

# Process: If Row Count Is (If Row Count Is) ()
if (Row_Count) != (Row_Count_2_):
    msg = "unmatched"
    print(msg)
   
else:
    msg = "matched"
    print(msg)
    send_mail("Data Error")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 20:29:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-model-builder-help/m-p/1106132#M46508</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-10-08T20:29:02Z</dc:date>
    </item>
  </channel>
</rss>

