Hi @Vamshi Konatham,
Welcome to the Microsoft Q&A Platform!
Unfortunately, Microsoft Forms has no official API that would enable you to generate forms or auto-fill responses prior to distributing the link. Microsoft Forms' API is largely dedicated to the collection of responses submitted to existing forms but doesn't provide features to create new forms or populate pre-filled responses. Though it has no native APIs for the following actions, here are a few workarounds you could apply:
- If your organization uses Microsoft Forms Pro, now known as Dynamics 365 Customer Voice, you might be able to create forms dynamically using Power Automate or the Common Data Service (CDS). By combining Power Automate with C# API calls, you can automate the process of creating forms, send unique links to users, and gather their responses. However, even with these tools, there’s no straightforward way to pre-fill answers before the user submits the form.
- Alternative Solution: Custom Web Form with Microsoft Forms API. Since it is not possible to dynamically create forms in Microsoft Forms, an alternative approach might be to:
- Create a custom form interface in your C# MVC application to look and feel like Microsoft Forms.
- Use a database to store the structure of your forms and any pre-filled answers. Collect user response directly in your database.
- Sync responses to the Microsoft Forms API as required and then track them.
- While Microsoft Forms doesn't have a built-in way to automatically fill in answers, there's an option you might be able to try. Sometimes, you can use query parameters in the URL that might pre-fill some of the text-based answers. However, this trick only works for questions where you type in the answer. It won't work for things like dropdown menus or questions where you can select multiple choices.
- Google Forms supports already-filled answers via URL parameters, and its API provides the ability to create forms programmatically, which might be a viable alternative if you're open to other solutions.
Overview:
https://learn.microsoft.com/en-us/power-automate/forms/overview
Hope the above provided information help in better understanding and help you resolve the issue, if you have any further concerns or queries, please feel free to reach out to us.
If the answer is helpful, Kindly Upvote it