AnsweredAssumed Answered

Handling a Table as a variable in a join ArcGIS 10.0

Question asked by wmarcell on Feb 24, 2012
Latest reply on Mar 1, 2012 by wmarcell
I have been working on migrating a 9.2 script to 10.0.  I have about completed the conversion from arcgisscripting to arcpy with the exception of the spatial analyst tools.  When I complete this I will need to determine how to handle our table joins in this script.

This is a hydrologic model that will use two user variables.  One is a start point for flow, the other is a hydrologic lookup table.  The user will have 3 lookup tables to choose from (good, fair, poor).  This was not an issue in the 9.2 script as a joined feature class would have the same named fields as the input (or at most an _1 that could be hard coded).  With 10.0, as you may well know, the joined fields are renamed using the table name (ex. GoodLookupTable_Value or FairLookupTable_Value depending on the table used)

Is there a simple way to have the python script handle this?  Is there a method to only allow them to pick 1 of the 3 tables and write an if statement that can handle this?  Or would I need to read the input as a string, and do some magic to determine what the field name will be?

I am hoping someone has solved this and can provide a quick fix.  Otherwise I will post what I come up with when I get to that point.

Thanks for any advice!  If you need more info or clarifications let me know.   My code is about 450 lines so I will not post it.  If you would like to see a little test code though I could probably put that up if needed.

Outcomes