+ Reply to Thread
Results 1 to 25 of 25

Thread: Using the attribute Assistant to populate a second lookup value

  1. #1
    Alison Gaiser
    Join Date
    Dec 2010
    Posts
    71
    Points
    7
    Answers Provided
    6


    0

    Default Using the attribute Assistant to populate a second lookup value

    My apologies that this isn't specifically a water utilities issue, but this forum seems to have the most traffic in relation to the Attribute Assistant, so I thought I would post here.

    I am using the attribute assistant (which by the way I think is wonderful) but I have run into a bit of a problem. Here is the scenario:

    I have road names that are created and maintained in a separate non spatial Oracle Database.
    I am creating spatial locations in an Oracle SDE geodatabase and need to lookup a road name and copy the value to the spatial feature.
    I am using the attribute assistant and the validate_attribute_lookup value method to get the road name and it works great.

    Now, what I need to do is while I am looking up the road name value, I need to get the unique road name id (another value associated with the table entry). Any suggestions on how I could do this? The road name ids are gibberish so the lookup is not helpful. Ideally, I would just like it to grab two pieces of information when I am doing the lookup.

    All suggestions are welcome.

    Alison

  2. #2
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0
    This post is marked as the answer

    Default Re: Using the attribute Assistant to populate a second lookup value

    Take a look at Copy_Linked_Record. You could run this after you get the street name and use the street name as the look up value.

    Value Method: COPY_LINKED_RECORD

    Value Info: Feature Layer|Field To Copy|Primary Key Field|Foreign Key Field

    Desc: This rules copies a value from a related table into the source feature based on a primary/foreign key relationship

    FieldName: Field to store the copied value on.
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  3. #3
    Alison Gaiser
    Join Date
    Dec 2010
    Posts
    71
    Points
    7
    Answers Provided
    6


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Thanks Mike that was very helpful. It looks to be working!

  4. #4
    James Whitacre
    Join Date
    Feb 2012
    Posts
    11
    Points
    0
    Answers Provided
    0


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Quote Originally Posted by MikeMillerGIS View Post
    Take a look at Copy_Linked_Record. You could run this after you get the street name and use the street name as the look up value.

    Value Method: COPY_LINKED_RECORD

    Value Info: Feature Layer|Field To Copy|Primary Key Field|Foreign Key Field

    Desc: This rules copies a value from a related table into the source feature based on a primary/foreign key relationship

    FieldName: Field to store the copied value on.
    Does this not exist in the ArcGIS 10 version of the Attribute Assistant tools? If not can anyone shed any light as to why or how I can get this functionality? It would be a huge help to our data editing workflow. Thank you.

    James

  5. #5
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    James,
    You can find that rule in a beta version.
    http://forums.arcgis.com/threads/200...l=1#post158222
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  6. #6
    James Whitacre
    Join Date
    Feb 2012
    Posts
    11
    Points
    0
    Answers Provided
    0


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Thank you for the quick reply!

  7. #7
    James Whitacre
    Join Date
    Feb 2012
    Posts
    11
    Points
    0
    Answers Provided
    0


    0

    Question Re: Using the attribute Assistant to populate a second lookup value

    Mike,

    I cannot seem to get the Copy Linked Record tool to work properly. Maybe I am misunderstanding how it works. Below is a description of my scenario.

    I am operating in a Personal Geodatabase. I have a feature class, named CollectionSites, and a non-spatial table, named SiteAssessments. Each site gets multiple assessments throughout the year (1:Many relationship). I have a relationship class between sites and assessments created in the geodatabase as a one to many with the sites OBJECTID as the primary key (Is this ok?) and a field named SiteID in the assessment table as the foreign key. Each site has a name, and I also want the site name to be passed to the assessments table when I create a new assessment record, which is created in the Attributes pane by right clicking on the table as it is shown in the branch and clicking on Add New. Both tables share the same field name for the site name, SiteName (would this cause some problems?). I have setup the Dynamic Value as such:

    Table Name: SiteAssessments

    Field Name: SiteName

    Value Method: COPY_LINKED_RECORD

    Value Info: CollectionSites|SiteName|OBJECTID|SiteID

    All others are set to True. Run Weight is null.

    When done, the SiteName field is null.

    Should this still work if a relationship class is present? I tried without the relationship class, and it still did not work. As light on what I am doing wrong? I included the debug text file. There is a line that indicates that the input feature is null. This isn't true, I think, so I am not sure what is happening. I am using other Dynamic Value methods and they are all working. This is the only one not working. Thanks in advance for your input and help. Have a great July 4th!

    James
    Attached Files

  8. #8
    Ligia Gafitescu
    Join Date
    Mar 2012
    Posts
    64
    Points
    1
    Answers Provided
    2


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    hello James,

    I am currently confronting with the same situation. Did you find the answer to your questions meanwhile?
    Ligia Gafitescu

  9. #9
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Can you post how you set the rule up? Here is the help.

    http://resources.arcgis.com/en/help/...0000099000000/
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  10. #10
    Ligia Gafitescu
    Join Date
    Mar 2012
    Posts
    64
    Points
    1
    Answers Provided
    2


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Quote Originally Posted by MikeMillerGIS View Post
    Can you post how you set the rule up? Here is the help.

    http://resources.arcgis.com/en/help/...0000099000000/

    Hello again


    I have a polyline feature class (DUCTS) and a table (CABLES). I am interesting in creating an entry in the cables table every time I bring a new duct in my FC. So let's say I bring a new duct which has 5 cables (field NO_CABLES), ideally for me would be to automatically create by means of a method 5 entries in the cables table; but if this is not possible at least one entry would be ok.


    So I tried using both copy_linked_records and create_linked_records. They seem the most likely to use methods for this. Maybe I misunderstood, this method copies/creates a record in a FC from a table (the opposite of what I need)? If this is the case what other method should I use?
    Is it a problem if foreign key and primary key have the same name?

    For CREATE_LINKED_RECORDS:

    Table name: DUCTS
    Field name: blank
    Value method: CREATE_LINKED_RECORD
    Value info: CABLES| NO_CABLES|NO_CABLES| DUCTS_ID|DUCTS_ID



    Thanks a lot again.
    Ligia Gafitescu

  11. #11
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    That should work, is the table editable? If you send me a schema and your dynamic value table, I can test in debug mode.
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  12. #12
    James Whitacre
    Join Date
    Feb 2012
    Posts
    11
    Points
    0
    Answers Provided
    0


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Ligia and Mike,

    I still have not been able to get the method to work for my purposes, which are similar to Ligia's. Therefore, I don't have anything useful to add, unfortunately.

    I may be able to develop a schema and DV table by the end of the week. My previous post does include a debug file.

    James

    P.S. Mike, thanks for picking up on this. If I could get this working, it would be a great help for our work flow!

  13. #13
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    1

    Default Re: Using the attribute Assistant to populate a second lookup value

    I think I found the issue. If the layer being edited was a table, it was exiting. I have implemented a fix that will work with Tables or GDB feature classes. It will be in the next release.
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  14. #14
    Ligia Gafitescu
    Join Date
    Mar 2012
    Posts
    64
    Points
    1
    Answers Provided
    2


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    If it is of any use now, I've uploaded a xml file with the schema and the AAdebug file. If not. we'll wait for the next release.

    As I was saying I am interesting in creating an entry in the cables table every time I bring a new duct in my FC. So let's say I bring a new duct which has 5 cables (field NO_CABLES), ideally for me would be to automatically create by means of a method 5 entries in the cables table; but if this is not possible at least one entry would be ok.

    Thanks again.
    Attached Files
    Ligia Gafitescu

  15. #15
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Ligia,
    Thanks for sending the data. Found a couple issues.

    1: Spaces: You have spaces after and before you entries in the value info
    CABLES|NO_CABLES|DUCT_ID|DUCT_ID
    instead of
    CABLES | NO_CABLES | DUCT_ID | DUCT_ID

    I will add handling for this in the code, but for now, remove the spaces

    2: Run Weight: You need to create the ID first, add a run weight for Generate ID that is higher than the Create/Copy linked rec

    3: Make sure to turn off Generate ID on Change

    4: The Copy_Linked_Record, it copies a value from the related record to the original feature, this is not what you want to use for no of cables.

    5: I created a new method, Update_Linked_Record to do what you want to do(matches the naming convention of the others). It will be in the next release. In the mean time, use Link Table Asset - http://resources.arcgis.com/en/help/...00000mr000000/. Make sure this rules run weight is the lowest.
    Last edited by MikeMillerGIS; 10-16-2012 at 03:19 AM.
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  16. #16
    Ligia Gafitescu
    Join Date
    Mar 2012
    Posts
    64
    Points
    1
    Answers Provided
    2


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Quote Originally Posted by MikeMillerGIS View Post
    Ligia,
    Thanks for sending the data. Found two issues. Also, the rule you want is Create_Linked_Record, not Copy_Linked_Record

    At least we now this is the method of choice

    1: Spaces: You have spaces after and before you entries in the value info
    CABLES|NO_CABLES|DUCT_ID|DUCT_ID
    instead of
    CABLES | NO_CABLES | DUCT_ID | DUCT_ID

    - Still nothing


    I will add handling for this in the code, but for now, remove the spaces

    2: Run Weight: You need to create the ID first, add a run weight for Generate ID that is higher than the Create/Copy linked rec
    Still nothing
    Ligia Gafitescu

  17. #17
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    I revised my previous post, please check again.
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  18. #18
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Attached is an updated version of the tools. These are a beta and not ready for release, but if you wanted to test the new rule I attached them. I also added a new option to the Create Linked Record rule to allow you to specify a field with the number of related records to create or a number for the number of related records to create. I attached your data schema and a dynamic value table with the rules filled out and working. There is one gotcha that I am not sure we can work around. If you open the relationship to the related records in the attribute dialog and click Add New, the DUCT_ID does not get populated until after the record is created, meaning we can use that field in the attribute assistant for a look up in the Duct record.
    Attached Files
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  19. #19
    Alison Gaiser
    Join Date
    Dec 2010
    Posts
    71
    Points
    7
    Answers Provided
    6


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Just out of curiousity is this zip for 10 or 10.1?

    Thanks!

  20. #20
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    The zip I posted is 10.1.
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  21. #21
    Ligia Gafitescu
    Join Date
    Mar 2012
    Posts
    64
    Points
    1
    Answers Provided
    2


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Quote Originally Posted by MikeMillerGIS View Post
    The zip I posted is 10.1.
    First of all thanks for all the effort invested in building this great tool. Second of all, maybe it was a misunderstanding or I didn't express myself right but it doesn't do quite what I need. So:

    NOW: when I build a new DUCT, it gives it an ID, and then I complete the field (No_cables = 5 ex) and it => creates 5 entries in my CABLES table (it's always 5 entries in the cables table) + copied the ID of the DUCT (this you've already nailed it) + it completes NO_cables= 5.


    What I wanted was: When I build a new duct, I want to give it an ID (DUCT_ID) + I want to create as many cables entries as many I write in the NO_CABLES field (from DUCTS FC)+ to copy the ID of the DUCT (this you've already nailed it) + if it still copies other fields would be genius (it does this too). So the difference would be the number of entries created.


    So let's say I draw a DUCT line-> I go in the attribute table-> enter 4/5/6/7 etc. in the field "NO_CABLES"-> AA generated an ID for my new DUCT-> then it created 4/5/6/7 etc. entries in my CABLES table+ it copied the DUCT_ID for each of the four cables + it copies extra field (optonal)- and result

    In other words, if you could do this, it would be marvelous, if not thanks a lot anyway.


    PS: cute new icons
    Ligia Gafitescu

  22. #22
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    I think the it can. You just need to set up a few edit templates. So instead of creating a Duct, set up a number of edit templates to be a 1 Cable Duct, 2 Cable Duct, 3 Cable Duct, 4 Cable Duct, and so on. Each of those edit templates already has the number of cables set(like the example I sent, 5 is already populated). Then when you draw the duct, it can use the number of cables field to generate the related records. Will that work?
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  23. #23
    Ligia Gafitescu
    Join Date
    Mar 2012
    Posts
    64
    Points
    1
    Answers Provided
    2


    0

    Talking Re: Using the attribute Assistant to populate a second lookup value

    Quote Originally Posted by MikeMillerGIS View Post
    I think the it can. You just need to set up a few edit templates. So instead of creating a Duct, set up a number of edit templates to be a 1 Cable Duct, 2 Cable Duct, 3 Cable Duct, 4 Cable Duct, and so on. Each of those edit templates already has the number of cables set(like the example I sent, 5 is already populated). Then when you draw the duct, it can use the number of cables field to generate the related records. Will that work?
    Fist of all, sorry for the late reply, I was away for the weekend.

    Second of all, you were right, I didn't try to edit templates. It does work when I use them! Sorry. my mistake. Plus it works when I append large amouts of data, which is absolutely great.

    Third of all, if it's not too much too ask, could you detail a bit "Value Info". I want to use the method in another geodatabase as well and I want to see if I get it right:

    Destination Table| Field to copy| Field where to copy | Foreign Key | Parent Key | Number of entries to create

    And would it be possible to copy several fields? Tried now and I couldn't

    Destination Table| Field to copy1, Field to copy2| Field where to copy1,Field where to copy2 | Foreign Key | Parent Key | Number of entries to create[/B]

    again, thank you a loooot.
    Ligia Gafitescu

  24. #24
    Michael Miller

    Join Date
    Mar 2010
    Posts
    631
    Points
    153
    Answers Provided
    31


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Here is the help - http://resources.arcgis.com/en/help/...000008m000000/

    Currently only one field is supported, but we could look at adding more than one field.
    Michael Miller
    Solutions Manager
    mmiller@esri.com

  25. #25
    Ligia Gafitescu
    Join Date
    Mar 2012
    Posts
    64
    Points
    1
    Answers Provided
    2


    0

    Default Re: Using the attribute Assistant to populate a second lookup value

    Quote Originally Posted by MikeMillerGIS View Post
    Here is the help - http://resources.arcgis.com/en/help/...000008m000000/

    Currently only one field is supported, but we could look at adding more than one field.
    thanks, that would be great.
    Ligia Gafitescu

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts