User Feedback Survey (updated) - How to Send Unity Data to Google Forms using UnityWebRequest

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.พ. 2025
  • using System.Collections;
    using UnityEngine;
    using UnityEngine.Networking;
    using UnityEngine.UI;
    public class Survey : MonoBehaviour
    {
    [SerializeField] InputField feedback1;
    string URL = "";
    public void Send()
    {
    StartCoroutine(Post(feedback1.text));
    }
    IEnumerator Post(string s1)
    {
    WWWForm form = new WWWForm();
    form.AddField("", s1);
    UnityWebRequest www = UnityWebRequest.Post(URL, form);
    yield return www.SendWebRequest();
    }
    }

ความคิดเห็น • 44

  • @NicholasAYam
    @NicholasAYam 3 ปีที่แล้ว +8

    Hey Mate, your video was detailed and concise! Can't thank you enough! Great work!

  • @MegaJHONDY
    @MegaJHONDY 2 ปีที่แล้ว +2

    I'm sad to see this dude doesn't have more videos 😭

  • @css2014
    @css2014 3 ปีที่แล้ว +1

    That was exactly what I needed. Thank you.

  • @dangerClose-ij4fj
    @dangerClose-ij4fj ปีที่แล้ว

    Oh thanks bro you really saved my life

  • @gitaecookiemonster2892
    @gitaecookiemonster2892 2 ปีที่แล้ว

    OMG this is it, this is what I was looking for! Thank you so much! .. 오 근데 한국인이신 것 같네요? ㅎㅎㅎ암튼 넘 감사합니다~!!! >

  • @MatheusWillian95
    @MatheusWillian95 11 หลายเดือนก่อน

    Nostalgia - CLAIR DE LUNE!

  • @brauliojorgealmeida
    @brauliojorgealmeida 2 ปีที่แล้ว

    Damn! This is gold! Thank you so much!

  • @G_Elektrik
    @G_Elektrik 2 ปีที่แล้ว +2

    This comment is for all wondering how to make it work with toggles or a form made for questions with multiple answers. I don't think there is info online about it. Let's say you have a form with the question: "favorite animal", with multiple answers: "cat" "dog" "bear", in unity you set your toggles in the same way, if a user clicks the toggle "cat" you can use in that particular toggle -onvaluechanged- and for example take the name of the toggle to identify it, and in your code for the value of that entry.XXXXXXX you have to pass that word as a string just like you have it in your form: "cat" in order to fill a question with multiple answers.

    • @G_Elektrik
      @G_Elektrik 2 ปีที่แล้ว +1

      @@full_bladder well i dont know if i explained my self well, but is not dificult, work almost same as this video, but you have to send the string for that entry with the exact text of the answer, i mean, lets say you have a form with a question with 3 answers, 1 cat 2 dog 3 bear, if in unity a person pick cat, you have to send the string with the text exactly like you have it in your form cat, the form recognice like if you choose cat and not the others.
      The way your code work in unity to recognize what toggle user is choosing is up to you, there are multiple methods, for example for the name of togle presed, or the function on value change or whatever you like.

    • @peliculasyseriespopulares5992
      @peliculasyseriespopulares5992 10 หลายเดือนก่อน

      Oye puedo contactarme contigo???

    • @G_Elektrik
      @G_Elektrik 10 หลายเดือนก่อน

      @@peliculasyseriespopulares5992 yes

    • @G_Elektrik
      @G_Elektrik 10 หลายเดือนก่อน

      @@peliculasyseriespopulares5992 yes

  • @asgorathalpha8316
    @asgorathalpha8316 6 หลายเดือนก่อน

    This was exactly what I needed. Do you by chance know what would need to be different if I do a multiple choice option?

  • @erdmaennchen105
    @erdmaennchen105 ปีที่แล้ว

    It worked, thanks

  • @stephenkimani7397
    @stephenkimani7397 4 ปีที่แล้ว

    Just what I needed! Thanks a lot for this man!

  • @uview920
    @uview920 3 ปีที่แล้ว

    감사합니다 :)

    • @1minunitytutorials720
      @1minunitytutorials720  3 ปีที่แล้ว

      ;)

    • @PhilM4
      @PhilM4 ปีที่แล้ว

      ​​@@1minunitytutorials720Hi, you said the code would be included in the description, but the toggle options aren't available and the code for the toggle wasn't shown fully in the video. Please help 😢

  • @mezzofyt
    @mezzofyt 10 หลายเดือนก่อน

    actually thank you

  • @tacticalmythic7945
    @tacticalmythic7945 3 ปีที่แล้ว

    thanks so much mate

  • @wilburdongchinyu2627
    @wilburdongchinyu2627 4 ปีที่แล้ว

    Hi can you share more on how i can add on more questions and then upload the answers to the google form? Great tutorial btw!

  • @SF.Carlos
    @SF.Carlos 2 ปีที่แล้ว

    Which version of Unity are you using? I tried this method in v.2021.3.6f1 and the UI "InputField" cannot be dragged to the Feedback 1 field under the Survey Script (component) in the inspector.

  • @maurincito
    @maurincito 3 ปีที่แล้ว

    thanks a lot..!!!!

  • @kalechips965
    @kalechips965 4 ปีที่แล้ว +2

    I get a 405 Method Not Allowed error when I attempt this. Any help would be greatly appreciated!

    • @kalechips965
      @kalechips965 4 ปีที่แล้ว +1

      public GameObject TestField;
      private string input;
      private string baseURL = "docs.google.com/forms/d/xxx/formResponse";
      IEnumerator Post(string input) {
      WWWForm form = new WWWForm();
      form.AddField("entry.xxx", "test");
      UnityWebRequest uwr = UnityWebRequest.Post(baseURL, form);
      yield return uwr.SendWebRequest();
      if (uwr.isNetworkError || uwr.isHttpError) {
      Debug.Log(uwr.error);
      }
      else {
      Debug.Log("Post Request Complete!");
      }
      Debug.Log(uwr.downloadHandler.text);
      }
      public void Send() {
      input = TestField.GetComponent().text;
      StartCoroutine(Post(input));
      }

  • @markezekieladona4689
    @markezekieladona4689 3 ปีที่แล้ว +1

    Hey bro the video was cut at the last part, do you have a continuation for this?

  • @xyhd0268
    @xyhd0268 4 ปีที่แล้ว +1

    Wow

  • @brandonbell3133
    @brandonbell3133 ปีที่แล้ว

    Which version of Unity is ideal for this? Does it still work with Unity 2022/2023? How can we prevent exact duplicates? Any way to add a Name field alongside the Feedback input field, so they can submit their name or email along with their feedback?

  • @CriarGames
    @CriarGames 2 ปีที่แล้ว

    Argument 1: Cannot convert from "System.Collections.IEnumerable" to "string" [Assembly-CSharp]csharp(CS1503) 😟😟

  • @PlayHolicGAMES
    @PlayHolicGAMES 10 หลายเดือนก่อน

    can we use different types like check boxes

  • @dr.araujo-junior
    @dr.araujo-junior 4 ปีที่แล้ว +4

    thank you so much! But I still need the toggle... The video cut out in the end... T_T

  • @trilingual6616
    @trilingual6616 3 ปีที่แล้ว

    01:16 Canadian moment. Welcome to the north

  • @harrymartin2188
    @harrymartin2188 2 ปีที่แล้ว

    I need multiple questions and I cant get it working, any help at all?

    • @standardLit
      @standardLit ปีที่แล้ว

      Hi! I can help you with multiple question if you still need it.

    • @harrymartin2188
      @harrymartin2188 ปีที่แล้ว

      @@standardLit I just chose to use google forms in the end without it on unity.
      Although any help would be brilliant for further uses

    • @ianlelis7757
      @ianlelis7757 ปีที่แล้ว

      ​@@standardLitHello!, Can you help me?, I need 5-10 Questions with multiple choices answers.

  • @nvolina
    @nvolina 3 ปีที่แล้ว +1

    Hi, anyway you can show the toggle script as well? Thank you :)

    • @1minunitytutorials720
      @1minunitytutorials720  3 ปีที่แล้ว

      Hello! I am sorry but I don't have the project now :( , and I barely remember what I did at that time.
      But I think I just sent the String value of the number corresponding to toggle like I did for the text. So for example, if user clicks the first toggle, it sends "1", etc.

  • @stephanogoncalves1672
    @stephanogoncalves1672 7 หลายเดือนก่อน

    Did not work for me

    • @stephanogoncalves1672
      @stephanogoncalves1672 7 หลายเดือนก่อน

      Solution: uncheck the "Limit to 1 response" option in the form.

  • @JUANZ503
    @JUANZ503 3 ปีที่แล้ว

    EASY

  • @drcatzill8955
    @drcatzill8955 4 ปีที่แล้ว

    Just what I needed! Thanks a lot for this man!