Join the Team Forms community

R
A
T
C
G

Dynamically?

Last updated 2 months ago
S
Sky

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

A
Anthony Phan
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
A
Anthony Phan

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 :)

S
Sky

Thank you for the instructions, they helped!

S
Sky

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

E
Erin Dwyer

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