none
SharePoint List field should be autopopulated based on another field's dropdown RRS feed

  • Question

  • Hi,

      I browsed about this topic and did not find exactly what I wanted. I want to autopopulate another field based on a dropdown field.

    Ex., Field 1 Country = USA, Eurpoe, India and China (these are the dropdown's)

           When USA is selected in Field 1, then "Field 2 Zip Code" should be populated.

          "Field 2 Zip Code" = Numeric Box.

           When India is selected in Field 1 Country,

           "Field 3 Postal Code" = Numeric Box, should be populated.

    Because in USA it is Zip code and in India it is Postal Code. This field will not be displayed until the selection is made.

    Is it possible without event receiver? I need to acheive this only with infopath or SharePoint designer(code).

     Please ask me if you don't understand the question. Your reply or help is much appriciated!

    Tuesday, July 23, 2013 8:47 PM

Answers

  • Hello,

    Yes, this possible in infopath form and designer. If you data is saved in sharepoint list then you can create an infopath form and create a secondary data connection to get data from list for Country, ZIP and postal code.

    Now first you need to one DDL for country and two textboxes for codes. Fill ddl with country from secondary data connection and add rule in both codes fields:

    1. If Field is blank then hide this control (add this rule for both controls so they could hide when form is open).

    2. Now Add rule on DDL field, If DDL is equal to USA then add an action for set Postal Code field.

    3. Second rule, If DDL is equal to India then add an action for set Zip Code field.

    same for china.

    Let me know in case any doubt


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 24, 2013 6:42 AM
    Moderator
  • Hi ,

    How do you want to autopopulate one field based on another filed value?
    Does every country have multiple Postcode/ Zipcode values in the form? Or each country only have one Postcode/Zipcode ? 
    Can you give more information about all the fields(e.g. field type) in the form?  And how do the fields of Postcode/ Zipcode display values? 

    If every country(in field1) has many Postcode/Zipcode items, and you want to only show/filter the Postcode/Zipcode items(in field2) belong to the selected country when you select a country, you can check the following article with using cascading dropdown field per the following article.
    https://www.nothingbutsharepoint.com/sites/eusp/pages/browser-based-infopath-2010---creating-cascading-dropdown-fields-with-no-code.aspx

    Or did you mean you want to hide/display one field based on another field value in InfoPath? You can use the Formatting rules to hide/display one field (or field in a section) based on another field value per the following article.

    http://www.edutechnow.com/?p=1376

    Thanks


    Daniel Yang
    TechNet Community Support

    Wednesday, July 24, 2013 7:47 AM
    Moderator

All replies

  • Hello,

    Yes, this possible in infopath form and designer. If you data is saved in sharepoint list then you can create an infopath form and create a secondary data connection to get data from list for Country, ZIP and postal code.

    Now first you need to one DDL for country and two textboxes for codes. Fill ddl with country from secondary data connection and add rule in both codes fields:

    1. If Field is blank then hide this control (add this rule for both controls so they could hide when form is open).

    2. Now Add rule on DDL field, If DDL is equal to USA then add an action for set Postal Code field.

    3. Second rule, If DDL is equal to India then add an action for set Zip Code field.

    same for china.

    Let me know in case any doubt


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 24, 2013 6:42 AM
    Moderator
  • Hi ,

    How do you want to autopopulate one field based on another filed value?
    Does every country have multiple Postcode/ Zipcode values in the form? Or each country only have one Postcode/Zipcode ? 
    Can you give more information about all the fields(e.g. field type) in the form?  And how do the fields of Postcode/ Zipcode display values? 

    If every country(in field1) has many Postcode/Zipcode items, and you want to only show/filter the Postcode/Zipcode items(in field2) belong to the selected country when you select a country, you can check the following article with using cascading dropdown field per the following article.
    https://www.nothingbutsharepoint.com/sites/eusp/pages/browser-based-infopath-2010---creating-cascading-dropdown-fields-with-no-code.aspx

    Or did you mean you want to hide/display one field based on another field value in InfoPath? You can use the Formatting rules to hide/display one field (or field in a section) based on another field value per the following article.

    http://www.edutechnow.com/?p=1376

    Thanks


    Daniel Yang
    TechNet Community Support

    Wednesday, July 24, 2013 7:47 AM
    Moderator