Join the Team Forms community

Updated 6 months ago

Dynamically?

At a glance
The community member asked if they can dynamically populate an address field when selecting a business name from a dropdown list in Team Forms. A community member responded that the easiest way to do this is to use SharePoint data sources. They provided step-by-step instructions on how to set up a SharePoint list or Excel file with name and address columns, create a dropdown list from the data, and use a calculated value to populate the address field based on the selected name. The community member also recommended watching a YouTube video for more details on calculated values. Another community member thanked the instructions, and asked how to add a map for the address in the form. The original community member responded that they addressed the mapping question in another post.
Useful resources

When I choose a Value from a drop-down list in Team Forms can that value populate the value its connected with dynamically example I choose business name and it populate the address

Marked as solution

Hi Sky,

Yes, the easiest way to do this is to use SharePoint data sources. First set up a SharePoint list or Excel file with a name and address column. Then set up a dropdown list with the data from the excel/list by following the data sources tutorial.

Now if I understand your question properly you want to automatically populate a text field with the address column when a specific name is selected in the drop-down menu. To do this we can use a calculated value using the steps below:

  1. Drag-and-drop a text field into your form to display the address

  2. In the data tab of the text field settings go to the calculated value property and enter the following JavaScript expression. Note that you will need to adapt the JavaScript to fit your specific form and column names.

    value = data.contact.Address

Here is an example of the final result.

Team Forms calculated value form a drop-down menu

Calculated values can be a little complicated and the expression needs to be tailored for you specific form and scenario, for this reason I recommend watching our YouTube video on this topic which dives into this feature in more detail :)

View full solution
A
S
E
1 comment·3 replies

Hi Sky,

Yes, the easiest way to do this is to use SharePoint data sources. First set up a SharePoint list or Excel file with a name and address column. Then set up a dropdown list with the data from the excel/list by following the data sources tutorial.

Now if I understand your question properly you want to automatically populate a text field with the address column when a specific name is selected in the drop-down menu. To do this we can use a calculated value using the steps below:

  1. Drag-and-drop a text field into your form to display the address

  2. In the data tab of the text field settings go to the calculated value property and enter the following JavaScript expression. Note that you will need to adapt the JavaScript to fit your specific form and column names.

    value = data.contact.Address

Here is an example of the final result.

Team Forms calculated value form a drop-down menu

Calculated values can be a little complicated and the expression needs to be tailored for you specific form and scenario, for this reason I recommend watching our YouTube video on this topic which dives into this feature in more detail :)

Thank you for the instructions, they helped!

I have another question if you don't mind. How can i add a map for this address in the form?

Hi Sky,

I've addressed your question in your other post below. My response focuses on using the address component to get the latitude/longitude to map, however if you are using a SharePoint data source to get the location you will need to add Latitude/Longitude as columns in your list/excel and adapt the provided code to reference those columns.

https://community.teamforms.app/support-W6pY1WFf9ty0/maps-8Vv7RzJ1z9zH