I am using the following import in my code:
from google.ads.googleads.v20.common.types.asset_types import ( 
LeadFormCustomQuestionField, LeadFormSingleChoiceAnswers, ) 

And here's the logic I'm using to add custom questions to a lead form:
for question in form_config.get("custom_questions", []):
    try:
        # Create the question object
        custom_question = client.get_type("LeadFormCustomQuestionField")
        custom_question.question_text = question["question_text"]

        if question.get("field_type") == "MULTIPLE_CHOICE":
            # Create SingleChoiceAnswers
            sc_answers = client.get_type("LeadFormSingleChoiceAnswers")
            sc_answers.answers.extend(question.get("answer_options", []))

            # Attach to the question object
            custom_question.single_choice_answers.CopyFrom(sc_answers)

        # Append the question to the lead form
        lead_form.custom_question_fields.append(custom_question)

    except Exception as e:
        logging.warning(f"⚠️ Skipping custom question due to error: {e}")

However, I am getting the following error:
WARNING:root:⚠️ Skipping custom question due to error: Unknown field for 
LeadFormCustomQuestionField: question_text 

It seems like question_text is not a valid field in 
LeadFormCustomQuestionField in version v20. Could you please confirm what 
field should be used to define the question text? I'm trying to create a 
Lead Form Asset using my own API, and I'm currently unable to send custom 
questions properly to Google Ads.

Also, the query you provided earlier doesn't return the list of custom 
questions either. Please help me resolve this.
------------------------------

Thank You
On Monday, July 14, 2025 at 8:13:07 PM UTC+5:30 Google Ads API Forum 
Advisor wrote:

> Hi,
>
> Kindly note that it’s not possible to retrieve the predefined qualifying 
> questions along with their answers through the Google Ads API. However, 
> it’s possible to retrieve the already created lead form questions along 
> with the answers through the Google Ads API. I would recommend you to use 
> the *asset.lead_form_asset.custom_question_fields* 
> <https://developers.google.com/google-ads/api/fields/v20/asset?hl=en#asset.lead_form_asset.custom_question_fields>
>  
> from *asset* 
> <https://developers.google.com/google-ads/api/fields/latest/asset> resource. 
> However, I’m providing the below GAQL query:
>
>
> SELECT asset.lead_form_asset.custom_question_fields FROM asset
>
> You can use the* search* 
> <https://developers.google.com/google-ads/api/rest/reference/rest/v17/customers.googleAds/search?apix=true>
>  
> or* searchStream* 
> <https://developers.google.com/google-ads/api/rest/reference/rest/v17/customers.googleAds/searchStream?apix=true>
>  
> methods in making the API calls while retrieving the data. Additionally, 
> you can utilize the *Google Ads Query Builder* 
> <https://developers.google.com/google-ads/api/fields/v20/asset_query_builder?hl=en>
>  
> and *Query Validator* 
> <https://developers.google.com/google-ads/api/fields/v17/query_validator> 
> to build and validate the queries for retrieving the data from the Google 
> Ads API. 
> Thanks,
>
>   
> [image: Google Logo] Google Ads API Team 
> Feedback
> How was our support today? 
>
> [image: rating1] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=1&entry.295079254=500Ht00001svNXaIAM>
>   
>   [image: rating2] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=2&entry.295079254=500Ht00001svNXaIAM>
>   
>   [image: rating3] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=3&entry.295079254=500Ht00001svNXaIAM>
>   
>   [image: rating4] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=4&entry.295079254=500Ht00001svNXaIAM>
>   
>   [image: rating5] 
> <https://docs.google.com/forms/d/e/1FAIpQLSeRhIg5VeThVmbcD0c5DTWTDjmpJuSktN8vFelEL7_KV_Orbg/viewform?usp=pp_url&entry.141427034=5&entry.295079254=500Ht00001svNXaIAM>
>
> [2025-07-14 14:42:06Z GMT] This message is in relation to case 
> "ref:!00D1U01174p.!500Ht01svNXa:ref" (ADR-00318348)
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/adwords-api/5a09bd65-1707-4a1f-aea3-e6a9e1f01b41n%40googlegroups.com.
  • Le... Rajat Singh
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Rajat Singh
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
          • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
            • ... Rajat Singh
              • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
                • ... Rajat Singh
                • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
                • ... Rajat Singh
                • ... Rajat Singh
                • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
                • ... Rajat Singh

Reply via email to