Join the Team Forms community

Updated last month

Autopopulate fields in Team Forms based on a selected item in a SharePoint

At a glance

The community member wants to populate fields in their Team Forms based on a selected item in a SharePoint list. They want to have a hyperlink in the "Evaluate" column that would redirect them to a pre-populated form with the Name, Email, and Contact information. The community member is open to other workarounds that could achieve a similar output.

In the comments, another community member suggests that the original approach might be overly complicated. They recommend having a single form where the responder selects the person from a drop-down menu and completes the evaluation in the same form, as this aligns better with Team Forms best practices. The community member also provides information on how to populate other fields based on a selected item in a SharePoint list, as well as how to pre-populate a form using a URL. They provide an example of how to launch one form from another with pre-populated data, but they don't recommend this approach as it's unnecessarily complex.

There is no explicitly marked answer in the comments.

Useful resources

I want to populate fields in my Team Forms based on a selected item in my SharePoint list. I want to use it in a case such as:

Name Email Contact Evaluate
Test use test@gmail.com 1037435467 Evaluate Candidate (hyperlink)

When I click the evaluate column, it would redirect me to my form which had already populated Name, Email and Contact for me.

Anyone who had already implemented a case like this? I'm also open to any other workaround that would have the similar output :)

E
1 comment

Hi @Yors,


Your questions have several distinct parts that I’ll address individually below. You should be able to combine these different functionalities to achieve what you’re describing. However, I suggest you might be overcomplicating your setup. You could simply have a single form where the responder selects the person from a drop-down menu and completes the evaluation in the same form instead of launching a separate, pre-populated form. This approach aligns better with Team Forms best practices, which encourage simplifying forms and processes wherever possible.


Populating other fields based on a selected item in a SharePoint list

The following article describes how you can do this with different component types like Text Fields, content and html component. You can use this approach to dynamically display hyperlinks to your next form based on the selected item


Pre-populating a form using a URL

You can use the method outlined in the article below to create a URL that is pre-filled with data. By combining this with dynamically referencing the response from the SharePoint list, you can dynamically construct a URL with pre-filled data based on the selected item.


Bringing it together

Here’s an example of one form launching another with pre-populated data. Note for the "Launch Evaluation" link I use the following dynamic html.

HTML / XML
<a href="https://web.teamforms.app/teams/team_Id/forms/form_Id/response?tenantId=tenant_Id&data={{ encodeURIComponent(JSON.stringify({name: data.spSelect.Name, email: data.spSelect.Email, department: data.spSelect.Department})) }}"> Launch Evaluation </a>


Again I don’t recommend this approach as it’s unnecessary complex. Instead, include the questions you want in the original form.