<?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: Calculate field with a variable attribute in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357897#M28263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the Reply Richard, I am in training all day today but will get back to you tomorrow. Appreciate the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2018 21:00:41 GMT</pubDate>
    <dc:creator>CommericalAnalytics</dc:creator>
    <dc:date>2018-03-27T21:00:41Z</dc:date>
    <item>
      <title>Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357888#M28254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I have a python script which creates a join between two layers.&lt;/P&gt;&lt;P&gt;I am then trying to use calculate field to take the data from one column (DemandWeight) and adding it to another column. However, the other column is made up from a variable so cannot be hard coded. For example, I have a variable called weightedvalue made up from attributes from another table. So after the join I have NetworkLocations.weightedvalue. But the message I get is that is not an actual column name. it is looking for the actual enbedded coIumn name. I also tried&amp;nbsp;&lt;SPAN&gt;NetworkLocations.%weightedvalue% but does not work either. The weighedvalue changes as per a loop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas would be appreciated&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 02:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357888#M28254</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-26T02:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357889#M28255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are running the script as a script tool, there is a dependency parameter that may cover your case.&lt;/P&gt;&lt;P&gt;Your field name for the calculation will 'depend' on the fields in that featureclass.&lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/setting-script-tool-parameters.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/setting-script-tool-parameters.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 03:02:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357889#M28255</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-03-26T03:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357890#M28256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may also be interested in reading this blog post (in case you want a solution without join and using dictionaries):&amp;nbsp;&lt;A href="https://community.esri.com/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries"&gt;/blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 03:09:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357890#M28256</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-03-26T03:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357891#M28257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much for this.&lt;/P&gt;&lt;P&gt;Both useful, especially the Turbo charging one. I have been racking my brains to get this sorted, and it looks like you have provided it.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 03:19:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357891#M28257</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-26T03:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357892#M28258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant, thanks for that.&lt;/P&gt;&lt;P&gt;Have been looking for a while.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 03:50:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357892#M28258</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-26T03:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357893#M28259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need any help with the script, just post back here&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 11:13:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357893#M28259</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-03-26T11:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357894#M28260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Xander,&lt;/P&gt;&lt;P&gt;Appreciate the help. This is my issue and it is the last step!&lt;/P&gt;&lt;P&gt;Below I am adding a variable weightfldval which is the attribute for the new table. This changes as per a loop earlier, and works fine.&lt;/P&gt;&lt;P&gt;The issue is where I create the updateFieldsList = ["BSB_Text", ?????] If I use weightfldval, then nothing happens, the data is not transferred . So I have the scenario where the columns have been create, just like I want, but nothing is transferred over from the DemandWeight of the FacilitiesOutput.&lt;/P&gt;&lt;P&gt;Let me know if this does not make sense. Appreciate any help. Again.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#with the sublayer names as the keys&lt;/P&gt;&lt;P&gt;        subLayers = dict((lyr.datasetName, lyr) for lyr in arcpy.mapping.ListLayers(outNALayer)[1:])&lt;/P&gt;&lt;P&gt;        FacilitiesSubLayer = subLayers["Facilities"]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;Process: Add Field (2)&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;        arcpy.AddField_management(ABN, weightfldval, "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")&lt;/P&gt;&lt;P&gt;        print("Added field to ABN_Opp_Metrics_Homeloan")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        #Create new Facilities FC&lt;/P&gt;&lt;P&gt;        arcpy.management.CopyFeatures(FacilitiesSubLayer,FacilitiesOutput)&lt;/P&gt;&lt;P&gt;        print("Facility Class Created")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;Transfer of a Single Field Value between Feature Classes&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;        sourceFC = r"C:\xxx\xxx\Scratch_Workspce.gdb\FacilitiesOutput"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        sourceFieldsList = ["Name", "DemandWeight"]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;Use list comprehension to build a dictionary from a da SearchCursor&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;        valueDict = {r[0]:(r[1:]) for r in arcpy.da.SearchCursor(sourceFC, sourceFieldsList)}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        updateFC = r"C:\xxx\xxx\Scratch_Workspce.gdb\ABN "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        updateFieldsList = ["BSB_Text", ?????]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        with arcpy.da.UpdateCursor(updateFC, updateFieldsList) as updateRows:&lt;/P&gt;&lt;P&gt;            for updateRow in updateRows:&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;store the Join value of the row being updated in a keyValue variable&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;               keyValue = updateRow[0]&lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;verify that the keyValue is in the Dictionary&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;            if keyValue in valueDict:&lt;/P&gt;&lt;P&gt;             &lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;transfer the value stored under the keyValue from the dictionary to the updated field.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;                updateRow[1] = valueDict[keyValue][0]&lt;/P&gt;&lt;P&gt;                updateRows.updateRow(updateRow)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        del valueDict&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        print "Finished script: " + strftime("%Y-%m-%d %H:%M:%S")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 23:05:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357894#M28260</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-26T23:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357895#M28261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure that is the problem actually. Even when I hard code the attribute, to test if the data is carried from DemandWeight to the Proposed Attribute, it does not work. So my issue might be somewhere else. Will have a look. I get no errors, just no data passes through to the new attributes. The dictionary data definitely has the desired attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2018 00:43:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357895#M28261</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-27T00:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357896#M28262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Warren:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you sure that the values in the Name field in the FacilitiesOutput FC exactly match the values in the BSB_Text field in the ABN FC?&amp;nbsp; The code will only transfer data where there is an exact match on the values in those fields.&amp;nbsp; Also, since you are only using two fields as a key and value to create the dictionary, you do not need to load the value portion into a tuple and can just return the value of the dictionary directly without indexing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;valueDict = {r[0]:r[1] for r in arcpy.da.SearchCursor(sourceFC, sourceFieldsList)}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;updateRow[1] = valueDict[keyValue]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2018 14:20:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357896#M28262</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2018-03-27T14:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357897#M28263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the Reply Richard, I am in training all day today but will get back to you tomorrow. Appreciate the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2018 21:00:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357897#M28263</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-27T21:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357898#M28264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If possible, please share (part of) the data. This makes the discussion&amp;nbsp;less complex and enables us to test the code and see where things might go wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 10:53:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357898#M28264</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-03-28T10:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357899#M28265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Richard,&lt;/P&gt;&lt;P&gt;Thanks for that.&lt;/P&gt;&lt;P&gt;I have done a join in arcmap to make sure they match up, and they do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if this is anything, but when I do a print of the dictionary and of the KeyValue&lt;/P&gt;&lt;P&gt;This is what I get:&lt;/P&gt;&lt;P&gt;Dictionary: {u'3923': 0.0, u'3920': 0.0, u'5259': 0.0, u'4023': 0.0, u'6725': 0.0,….&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KeyValue: 2003&lt;/P&gt;&lt;P&gt;2006&lt;/P&gt;&lt;P&gt;2010&lt;/P&gt;&lt;P&gt;2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the four digit numbers are in both, but maybe it is the format of the dictionary?&lt;/P&gt;&lt;P&gt;I am hesitant to add data, but if it will make it easy for you to help, I will clean it up and attach some.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 22:49:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357899#M28265</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-28T22:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357900#M28266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you think the code is not working?&amp;nbsp; The DemandWeight values all appear to be 0.0 in your sample, so if that is what you are seeing for keys like u'3923', u'3920', u'5259', u'4023', u'6725', etc., the code worked.&amp;nbsp; Show what you expect the value to be for those keys.&amp;nbsp; I suspect you are not populating the DemainWeight during any pass of your code, like you may have done in your Model.&amp;nbsp; Also, the code you showed does not use a real output field name (?????), so I don't know if that is an issue.&amp;nbsp; If a join succeeded, that indicates that both tables have a text field value that you are matching and would both contain unicode keys like&amp;nbsp;u'2003',u'2006',u'2010',u'2013', not numeric values like 2003, 2006, 2010, 2013.&amp;nbsp; Anyway, without the ability to see the actual table key value pairs the dictionary was told to read or the output table, it is impossible to identify where the mismatch is between your code and what you actually want&amp;nbsp;the code to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 23:02:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357900#M28266</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2018-03-28T23:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357901#M28267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will send through some of the data.&lt;/P&gt;&lt;P&gt;I know it is not working as the end result are null values (every row), not 0.&lt;/P&gt;&lt;P&gt;Also most of the data are zero’s as to get this Model working I have decreased the number of rows drastically. The first part of the script is a network analysis location-allocation model.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 23:10:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357901#M28267</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-28T23:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357902#M28268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please complete what you actually used for this line of code for the output field name:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;updateFieldsList = ["BSB_Text", ?????]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;The output field would be&amp;nbsp;wahtever field you used in place of ?????&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Also, your dictionary indicates the values associated with the keys are not within a tuple, so it does not seem you are using your original code.&amp;nbsp; Anyway, you would have to make sure the line populating the output field is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN&gt;updateRow[1] = valueDict[keyValue]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 23:17:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357902#M28268</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2018-03-28T23:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357903#M28269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Richard,&lt;/P&gt;&lt;P&gt;What I am trying to do with the script below is take the DemandWeight column in the Facilities layer to the Value column in the ABN layer, using the BSB as the primary key.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 23:19:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357903#M28269</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-28T23:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357904#M28270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this case, it would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;updateFieldsList = ["BSB_Text", “Value”]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as per the example data I sent through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 23:25:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357904#M28270</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-03-28T23:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357905#M28271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to make the &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;updateFieldsList = ["BSB_Text", ?????]&amp;nbsp;&lt;/SPAN&gt;line read:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;updateFieldsList = ["BSB_Text", "Value"]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;I am backing up to code that I you did not show completely.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Where do the variables ABN and weightfldval get set and what values do they have?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN&gt;arcpy.AddField_management(ABN, weightfldval, "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;I do not see where you set the&amp;nbsp;&lt;SPAN&gt;FacilitiesOutput variable value.&amp;nbsp; I believe it&amp;nbsp;should match the same path and FC name as the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;sourceFC = r"C:\xxx\xxx\Scratch_Workspce.gdb\FacilitiesOutput"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN&gt;arcpy.management.CopyFeatures(FacilitiesSubLayer,FacilitiesOutput)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN&gt;Also I hope you removed the erroneous space character that comes after ABN&amp;nbsp;in&amp;nbsp;this line of code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN&gt;updateFC = r"C:\xxx\xxx\Scratch_Workspce.gdb\ABN "&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN&gt;should be&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN&gt;updateFC = r"C:\xxx\xxx\Scratch_Workspce.gdb\ABN"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN&gt;If your code still does not work try running this code using hardcoded values and get it to work.&amp;nbsp; Then you can modify all of the processes that set your input FCs, layers, etc based on variables.&amp;nbsp; If the base code below works and then breaks as you modify the way inputs and outputs are determined at runtime, then you will know the problem is not in this part of the code.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy&amp;nbsp; 
&amp;nbsp; 
# hardcode the path to the correct gdb and FC
sourceFC = r"C:\xxx\xxx\Scratch_Workspce.gdb\FacilitiesOutput"&amp;nbsp; 
&amp;nbsp; 
sourceFieldsList = ["Name", "DemandWeight"]&amp;nbsp; 
&amp;nbsp; 
# Use list comprehension to build a dictionary from a da SearchCursor&amp;nbsp; 
valueDict = {r[0]:r[1] for r in arcpy.da.SearchCursor(sourceFC, sourceFieldsList)}&amp;nbsp; 
&amp;nbsp; 
# hardcode the path to the correct gdb and FC
updateFC = r"C:\xxx\xxx\Scratch_Workspce.gdb\ABN"&amp;nbsp; 
&amp;nbsp; 
updateFieldsList = ["BSB_Text", "Value"]&amp;nbsp; 
&amp;nbsp; 
with arcpy.da.UpdateCursor(updateFC, updateFieldsList) as updateRows:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for updateRow in updateRows:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # store the Join value of the row being updated in a keyValue variable&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keyValue = updateRow[0]&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # verify that the keyValue is in the Dictionary&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if keyValue in valueDict:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # transfer the value stored under the keyValue from the dictionary to the updated field.&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[1] = valueDict[keyValue]&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow)&amp;nbsp; 
&amp;nbsp; 
del valueDict‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:44:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357905#M28271</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2021-12-11T16:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357906#M28272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just did a test with the "data" you provided. I had to read it into a fgdb to mimic the situation that you have and change the schema, since things get altered when you export the data to a text and csv file. Next time please provide the data in its original format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the code below that I used:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;main&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# define input tables and fields&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tbl_source &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\GeoNet\CommericalAnalytics\data.gdb\FacilitiesOutput'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_source_key &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Name'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_source_val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'DemandWeight'&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# define output tables and fields&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; tbl_destination &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'C:\GeoNet\CommericalAnalytics\data.gdb\ABN'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_dest_key &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'BSB_Text'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_dest_val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Value'&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# create dictionary of input&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fld_source_key&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fld_source_val&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; dct_source &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; r &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl_source&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; flds&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# update output&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fld_dest_key&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fld_dest_val&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl_destination&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; flds&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; curs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; curs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dest_key &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; dest_key &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; dct_source&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; dct_source&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;dest_key&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; __name__ &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'__main__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; main&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table get's updated, although some BSB_Text values are missing in the FacilitiesOutput table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the&amp;nbsp;ABN table the values get updated:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/400099_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BSB_Text 3035 in this example is not in the&amp;nbsp;&lt;SPAN&gt;acilitiesOutput table.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:44:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357906#M28272</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T16:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field with a variable attribute</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357907#M28273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Xander,&lt;/P&gt;&lt;P&gt;Thank you very much for the time, effort and input, I greatly appreciate it.&lt;/P&gt;&lt;P&gt;It is working now. The issue I was having was it was running through the loop without doing the copying data from one feature to the other.&lt;/P&gt;&lt;P&gt;When  I fixed that it worked like a dream.&lt;/P&gt;&lt;P&gt;Again, thanks for all your help and the help of the others.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Warren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2018 00:19:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-with-a-variable-attribute/m-p/357907#M28273</guid>
      <dc:creator>CommericalAnalytics</dc:creator>
      <dc:date>2018-04-04T00:19:55Z</dc:date>
    </item>
  </channel>
</rss>

