Using CFHTTP to submit a form directly to a google docs form

Ok so here is some background
Google has a service where you can create forms using google docs and embed them into your webpage, Results are automatically stored in a google spreadsheet upon submission.
I want to use my own form to submit to to the google form processing page which I can get to work however the default generic google hosted thank you page appears upon submissing.
I know you can use cfhttp to submit a form from a coldfusion server so I was thinking that I could simply pass my form variables to a action page that resubmitted them via cfhttp and thus bypass the thank you page altogether
however when I try this it does not work and the results do not show up in the google spreadsheet. I figured that mabye the google processing page could tell that it was not submitted from a browser so I tired adding a useragent string but still no luck.
Here is the code I was trying to use
<cfhttp method="POST" url="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" redirect="yes" useragent="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)">
     <cfhttpparam type="Formfield" name="entry.0.single" value="testValue1" >
     <cfhttpparam type="Formfield" name="entry.1.single" value="testValue2" >
</cfhttp>
And the online spread sheet can be viewed here
http://spreadsheets.google.com/pub?key=tlo4FjygqMuUGmvuOb2_Gjw&single=true&gid=0 &output=html
Does anyone know why this is not working?
To recap I am able to use the following form on my own comptuer to directly submit to the processing page and this works
<form action="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" method="POST">
<input type="text" name="entry.0.single" value="" >
<input type="text" name="entry.1.single" value="">
<input type="submit" name="submit" value="Submit">
</form>
Any help would be greatly appreciated

YES!!!!!!!!!!!!!!!!!!!!!! This did it final code is as follows thanks for you help
<cfhttp method="POST" url="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" useragent="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)">
     <cfhttpparam type="Formfield" name="entry.0.single" value="final test">
     <cfhttpparam type="Formfield" name="entry.1.single" value="final test">
      <cfhttpparam type="Formfield" name="submit" value="Submit">
</cfhttp>
Man this is great! and has eliminated half my database requirements! now only if you could pull the results back out!

Similar Messages

  • Need to copy form tag in source for google docs form...cannot find it?

    I have a google docs form that has worked, but they have just introduced an acknowledged bug that kills it.
    SO, i need to copy the form tag from the source code, but there is no form tag (in safari or FF on mac viewing on me.com). It is in an iweb HTML widget, does this some how change where I find the form tag?
    Below are the steps. Looking at non-iweb site with google form, the form tag is there.
    Where is it in iweb?
    Thanks
    bob
    5) Right click anywhere on the page and click View Source to look at the code behind the form.
    6) Copy all the code between <form> and </form> tags and paste it into the new form page on your web site.

    This was my bad, I realized that the instructions were referring to the form tags in source of the google docs forms website...since it is hosted, the form is not actually in iweb.
    Google forms changed, after submit instead of a link to return to the form (i.e. your web) the link now says "create your own form" which means the user has not way to return (except the browser back button). Google says they will correct it in a future version...
    thanks
    bob

  • Can i Include a Google Doc Form in the animation?

    That

    Hi, Im trying now to Ligthbox a Iframe. Anyone knows how to do it? I downloaded the Fancybox but i cant make it work. Is there another option?

  • How to use Direct Access URL in the FORM tag

    I want to substitute the pageid url (/servlet/page?_pageid=161&_dad=portal30&_schema=PORTAL30) with the direct access urls (pls/portal30/url/page/my_page) to address the pageid conflict between development server and production server.
    It works perfectly fine in the redirection code such as:
    self.location.href="/pls/portal30/url/page/next_page". But I got "Page can not be found" error message when I use it in the <FORM> tag:
    <FORM ACTION="/pls/portal30/url/page/next_page" METHOD="POST" NAME="my_form">
    Does anyone out there know how to use the direct access url inside the <FORM> tag? I am trying not to write a bunch of code just to retrieve and insert the pageid at the run time.
    Thanks in advance.
    Arthur

    Use condition. If you are validating a record, just out the desired check in the condition field for that specific item.
    Thanks
    Nagamohan

  • Problem using javascript to submit jsf form, values not submitted

    Greetings!
    I have a t:selectOneMenu where I want the page to be submitted when they change the selected value. At this point, I am able to get the form to submit and reload the page, which is all fine. The problem is that none of the values from the page are not set in the backing bean. I have break points on the setter methods that are not being hit.
    I have tried a number of things from searching multiple forums, but here are snippets from my latest version...
    <h:form>
    <t:commandLink id="hiddenLink" forceId="true" value="test link"
    action="#{pc_PageX.doBtnHiddenLinkAction}"></t:commandLink>
    <t:selectOneMenu id="pageList_top" forceId="true" value="#{pc_PageX.ValueX}"
         onchange="jspellSync(); submitPageX();">
         <f:selectItems value="#{pc_PageX.ListX}" />
    </t:selectOneMenu>
    </h:form>
    function submitPageX(){
         var hiddenLink = document.getElementById("hiddenLink");
         hiddenLink.click();
    }Note that the <t:commandLink> is not hidden, though it will be in the final version if I can get this to work.
    If I click the commandLink myself, the page is submitted with all the page values as expected. If I change the list value, thus using javascript to fire the commandLink's click event, the page is submitted with NO values.
    Can anyone come up with an explanation for this behavior? Or better yet, a solution?
    A couple other things I've tried...
    - Not using a commandLink and using jsf's submit function -> onchange="jspellSync(); submit();"
    - Clicking the link using other ways -> hiddenLink.fireEvent('onclick');
    If all else fails, I'll just add a button that they have to click to submit the form.

    snotmare wrote:
    BalusC wrote:
    I recall this problem in one of the ancient JSF versions. Which JSF version do you use? Do you have any room to upgrade to latest? We're using an IBM implementation of JSF, which is at version 7.0. The IBM implementation appears to be built on the JSF base 1.1.That's not an IBM JSF implementation, they do not have any one, they just have some component libraries which runs on top of some JSF implementation. RAD/WSAD ships by default with Sun JSF RI. Try upgrading to at least 1.1_02 which you can download from the aforementioned link. There's a gap of 2 years (and inherently a lot of bugfixes) compared to 1.1. If the application server used supports Servlet 2.5, you could even upgrade to the latest 1.2.
    We've had other issues with the IBM implementation, which could be the cause in this case too. We've been talking about switching to MyFaces, but there is one feature of the IBM version that we like. It's basically a script collector (hx:scriptCollector) that allows us to do pre-processing on the page.As said before, IBM does not have a JSF implementation. So replacing RI by MyFaces wouldn't make any difference.

  • I want to print form directly with out using spool request

    hi,
            i want to print form directly with out using output type screen (spool request or print preview ) , i want to supress the screen and get output directly to the printer. plz help me
    thanks&regards
    praveen

    Hi Praveen,
    In your program, where you are calling the OPEN_FORM function.. pass the name of the printer in the 'DEVICE' parameter of the function module..
    Also, there is a parameter OPTIONS of sturcture ITCPO in the same function module.. in this parameter you will find lot of options to set properties for the printing..
    There will be one field for immediate printing, set that field to 'X' and other settings for print in the same structure and pass to the function module..
    Thanks and Best Regards,
    Vikas Bittera.

  • I created a pdf form and then iported it to Forms Central for distribute. It is now loaded to my website and setup so a person clicks on the link to open the form. At this point they then have to go to upper right to open form using a different view. I wo

    I created a pdf form and then imported it to Forms Central for distribute. It is now loaded to my website and setup so a person clicks on the link to open the form. At this point they then have to go to upper right to open form using a different view. I would like the form to open directly in Adobe Reader form to make it easier to enter information. Thanks, Ike

    If you created it in Forms Central, you have to edit it there. I believe Forms Central is similar to LiveCycle Designer in that the form created is no longer able to be edited in Acrobat. I might be wrong, but that is my understanding. You add the submit button in Forms Central. Within Acrobat, you should be able to go to the forms menu and Manage Data to save the data to an Excel file. Others better with forms should be by to clarify things, but this should get you started. In the future you might find it better to post a forms question in the forms discussions.

  • Sending PDF form directly to email

    Is it possible to send filled PDF form directly from Acrobat Pro or Reader to requested email by clicking the SEND button? Or does it always go via senders email application?
    What should be done to get it going directly?

    Is it possible to send filled PDF form directly from Acrobat Pro or Reader to requested email by clicking the SEND button? Or does it always go via senders email application?
    Answer: To bypass client-side email software the form needs to submit to a server side script such as PHP or ASP.net.
    What should be done to get it going directly?
    Answer: You will need an SMTP account, a web server and server-side programming knowledge. The script would need take the inbound submission stream and pass it to the outbound SMTP message, and return a FDF response message or redirect to a URL. If you are using ASP.net, you can use iTextSharp or FDFToolkit.net to parse the submission, and inject the values directly into the message TO, CC, BCC, subject and body.
    For online examples please visit the following website: www.pdfemail.net/examples/

  • Creating a cfhttp multi part form post for google docs upload

    Hey all,
    If you saw my last thread, you know I am working with google docs and uploading documents to it. Well I got basic document uploading working, but now I am trying to include meta data. Google requires you to include the metadata with the actual file data and seperate them by using a multi part form upload. I don't know exactly the process for doing so, but they have a handy code snippet of the desired results at
    http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#UploadingDoc s
    So I am basically trying to mimic that payload, however I am continually getting an error stating that there are no parts in a multi part form upload.
    <errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>InvalidEntryException</code><internalReason>No parts detected in multipart message</internalReason></error></errors>
    to be exact. I am not really sure what I am doing wrong here. I figure it is one of two things, either I am not including the actual data in the payload properly (I am currently using a body type param for the payload, but I have also tried a formfield named content to deliver it. Neither worked). So maybe I need to do something else tricky there? The other thing which I am not reallly sure about is the content-length attribute. I don't know exactly how to calculate that, and I read in another forum that a content length attribute was messing that guy up. Right now I am just taking the lenght of the payload string and multiplying by 8 (to get the number of bytes for the entire payload) but hell if I know if that is right. It could be I just don't know how to set up the parts for the message, it seems pretty straight forward though. Just define a boundary in the content-type, then put two dashes before it wherever you define a new part, and two dashes trailing the last part.
    Anyway, here is my code, any help is much appreciate. I'm a bit beyond my expertise here (not really used to trying to have to roll my own http requests, nevermind multipart post form data) so I'm kinda flailing around. Thanks again.
    <cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
        <cfargument name="filePath" type="string" required="false" hint="file to upload.">
        <cfargument name="docType" type="string" required="yes" hint="The document type to identify this document see google list api supported documents">
        <cfargument name="parentCollectionId" type="string" required="no" hint="the name of the collection/collection to create (include collection%3A)">
        <cfargument name="metaData" type="struct" required="no" hint="structure containing meta data. Keyname is attribute name, value is the value">
        <cfset var result = structnew()>
        <cfset result.success = true>
        <cftry>
            <cfif structkeyexists(arguments,"parentCollectionId")>
                      <cfset arguments.parentCollectionId = urlencodedformat(parentCollectionId)>             
                      <cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/#arguments.parentCollectionId#/contents">
                <cfelse>
                        <cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/">
            </cfif>
             <cfoutput>
                  <cffile action="read" file="#arguments.filePath#" variable="theFile">
                <cfsavecontent variable="atomXML">
                     Content-Type: application/atom+xml
                    <?xml version='1.0' encoding='UTF-8'?>
                    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
                      <category scheme="http://schemas.google.com/g/2005##kind"
                          term="http://schemas.google.com/docs/2007###arguments.docType#"/>
                        <cfloop collection="#arguments.metaData#" item="key">
                            <#key#>#arguments.metadata[key]#</#key#>
                        </cfloop>
                    </entry>
                    --END_OF_PART
                    Content-Type: text/plain
                    #theFile#
                    --END_OF_PART--
                </cfsavecontent>       
            </cfoutput>      
            <cfset result.postData = atomXML>
            <cfhttp url="#result.theUrl#" method="post" result="httpRequest" charset="utf-8" multipart="yes">
                <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
                <cfhttpparam type="header" name="GData-Version" value="3">
                <cfhttpparam type="header" name="Content-Length" value="#len(trim(atomXML))*8#">           
                <cfhttpparam type="header" name="Content-Type" value="multipart/related; boundary=END_OF_PART">
                <cfhttpparam type="header" name="Slug" value="test file --END_OF_PART">
                <cfhttpparam type="body" name="content" value="#trim(atomXML)#">
            </cfhttp>
            <cftry>
                   <cfset packet = xmlParse(httpRequest.fileContent)>
                <cfif httpRequest.statusCode neq "201 created">
                    <cfthrow message="HTTP Error" detail="#httpRequest.fileContent#" type="HTTP CODE #httpRequest.statusCode#">
                </cfif>
                <cfset result.data.resourceId = packet.entry['gd:resourceId'].xmlText>
                <cfset result.data.feedLink = packet.entry['gd:feedLink'].xmlText>
                <cfset result.data.title = packet.entry.title.xmlText>  
                <cfset result.data.link = packet.entry.title.xmlText>    
                <cfcatch>
                     <cfset result.data = httpRequest>
                </cfcatch>
            </cftry>       
            <cfcatch type="any">
                 <cfset result.error = cfcatch>
                <cfset result.success = false>
            </cfcatch>
        </cftry>   
        <cfreturn result>
    </cffunction>
    Also, this is what my atomXML data ended up looking like when it got sent to google. This isn't the WHOLE request (it doesn't include the headers, just the body).
    Content-Type: application/atom+xml
    <?xml version='1.0' encoding='UTF-8'?>
    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#document"/>
    <TITLE>Woot Test</TITLE> </entry>
    --END_OF_PART
    Content-Type: text/plain
    I'm a test document lol!
    --END_OF_PART--

    Woot, I got it. I had to send the gData version number, and change the URL.
    Here is the working function.
    <cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
        <cfargument name="myFile" type="string" required="false" hint="file to upload.">
        <cfset var result = "">
        <cfset theUrl = "https://docs.google.com/feeds/default/private/full">
        <cffile action="read" file="C:\website\xerointeractive\testing\test.txt" variable="theFile">
        <cfset fileSize = createObject("java","java.io.File").init("C:\website\xerointeractive\testing\test.txt").length()>
        <cfhttp url="#theURL#" method="post" result="result" charset="utf-8" >
            <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
            <cfhttpparam type="header" name="Content-Type" value="text/plain">
            <cfhttpparam type="header" name="Slug" value="test file">
            <cfhttpparam type="header" name="GData-Version" value="3">
            <cfhttpparam type="header" name="Content-Length" value="#fileSize#">
            <cfhttpparam type="body" value="#theFile#">
        </cfhttp>
        <cfreturn result>
    </cffunction>

  • [OIM] Error in Direct Provisioning (with auto save form) - GTC DB App Table

    Hi,
    I am getting an error when setting up direct provision of a GTC DB App Conn using OIM access policy (and group membership) or through manual provisioning with prepopulate and auto save form.
    Manual provisioning with prepopulate ONLY (not with auto save form) WORKS!!!
    Some information about my OIM config:
    - Prepopulate adapters are set up on both forms (parent and child)
    - "Auto prepopulate" and "Auto save form" are set up at Process Definition
    - For direct provisioning, I have created an access policy with an associated group which has a membership rule
    What it is working:
    - Provisioning manually, using prepopulate adapters only, not auto save form. Both tables are updated properly
    - All *3 tasks are called and finished with status=Completed*: "System Validation", "Create User" and "Child Table UD_<connector child table name>_US row Inserted"
    Testing direct provisioning:
    - I have tested adding the resource manually with prepopulate and autosave form configured, and also through access policy/group membership. The error is the same on both tests
    - The resource is displayed as provisioned and it is created an entry in the parent table of the resource, but not on child table
    - I also observed that only: "System Validation" and "Create User" tasks were executed (status=Completed). But it is missing the task "Child Table UD_<connector child table name>_US row Inserted"
    - The error log info displays only an error regarding to UGP table (Groups info) but I am not sure if that is the cause of entry creation on child table.
    It seems the SQL stmt tries to get ugp_name (group name) using ugp_key but that has null value.
    "SELECT ugp_name FROM ugp WHERE ugp_key=java.sql.SQLSyntaxErrorException: ORA-00936: missing expression"
    Note: When testing manually (without auto save form), I got "SELECT ugp_name FROM ugp WHERE ugp_key=1" which it is the same SQL stmt but the value is provided.
    My guess:
    - It seems that error is aborting the whole execution process so "Child Table UD_<connector child table name>_US row Inserted" task does not run, even though previous tasks are finished with the status=Completed. Consequently, the entry is not created on child table.
    Please, any guess or help would be very helpful. In case nothing works, I guess I will have to create and customize a "Update child Form" task as an workaround which would be called after "Create User" task.
    Regards,
    Hugo
    My environment:
    - Windows 2003, WebLogic 10.3.0.0, OIM 9.1.0.2 BL4, Oracle 10g, Java 1.6, DB App Table Connector 9.1.0.2 (from October 2009)
    - Target Resource: Parent and Child Table (Oracle 10g - the same OIM DB)

    An update:
    I solved that error about "ORA-00936: missing expression" applying OIM 9.1.0.2 BP05. That was not impacting my issue regarding direct provisioning with auto save form and child form.
    So please if anyone can confirm:
    - Can I set up prepopulate adapters on child forms AND also use "auto save form" on GTC DB App Table connector?
    If not, any suggestion?
    Regards
    Hugo

  • Sharepoint 2010, InfoPath 2010 with Custom Workflow. Error Message: InfoPath cannot submit the form. An error occured while form was submitted...

    I have created an InfoPath form that submits to a Sharepoint library with custom workflow attached. The workflow is initiated when the user submits the form. An email is sent to the supervisor who clicks the "Encoded Absolute URL" and approved
    the form via the emailed form. Then, based on certain criteria the form is either emailed to the VP or the workflow is complete. The VP is sent an email and clicks the "Encoded Absolute URL" and sumbits the form via the emailed form. This is
    how I would like it to work. The reality is, the form submits and is emailed to the supervisor and the supervisor is able to approve but when the form is sumbitted I get an error. The error is "InfoPath cannot submit the form. An error occured while
    this form was being submitted. The form cannot be submitted to the following location: <URL> The file <URL> is checked out for editing by <me> The operation completed successfully." The operation did not complete successfully and it
    is not checked out. I have read in previous posts that the file is locked. Since I am in the testing faze of the project there is no one else using the form. I have waited 24 hours and the lock has not been released. Please help!!! My deadline is growing short.

    I ran into your post while having a similar issue.  I don't have a 'full' fix for you, but I noticed at least in our case if you made sure you opened the Infopath form through the browser instead of the client Infopath program (use the drop-down menu
    and open in browser) the error doesn't occur.  Hope that helps some....

  • How to scan document into forms directly ?

    hi all
    how to scan any document into oracle developer form directly
    (we are using forms 4.5 ..on win 98)
    thanks
    Abu zaid Saad
    [email protected]

    First I would suggest that you read the documentation about working with Active/X.
    The online version is in the documentation section of Forms on OTN.
    Then, you insert the scan.ocx into your form. you use the ole importer to create a pl/sql package to communicate with the ocx and you are ready to start calling methods such as scan etc...

  • Experience porting 4.5 forms directly to 9i ??

    We are to port about 1000 4.5 forms and 500 6i forms (client/server) to forms 9i.
    Does anybody have any experience with porting 4.5 forms directly to forms 9i or is it necessary to go 4.5 -> 6i -> 9i ?
    Is it possible to use tools like 9i Migration Assistant, Forms*Nova, MIGrator or the like to do this in batch mode?
    Thanks for any help
    Christian

    Christian,
    the Forms Migration Assitant simply goes through your Forms Module and searches for changed built-ins or obsolete names. The real crux of migration is a change that happened between Forms 4.5 and Forms 5.0 in the Forms internal architecture.
    MIGrator is a tool offered by companies like Logis, XRSystems and Kybernon (where the second two licenced the product as far as i know) that performs a complete migration, also checking for the architectural changes.
    MIGrator is able to move Forms 3.0 applications to Forms 6i (and possibly higher) and really suited for customers with different versions of Forms.
    There are other companies in the same sector that are worth looking. PITTS.CON does do the same Job.
    For the sake of being neutral, here's a list of all partners offering migration tools:
    http://otn.oracle.com/products/forms/htdocs/partners.html
    The recommendation is to go from Forms 4.5 to 6i and then to Forms9i (you don't have to move to Forms9i first to get to Forms10g (9.0.4)).
    Frank

  • How can i use a hand held id scanner to input information to a form

    I have a honeywell handheld barcode scanner used to scan bar codes on the back of licenses. I want to use the scanner to directly fill in an PDF form i have created. Is this something that is possable?

    Not unless you write a custom C++ plugin. Barcode scanners cannot directly pipe information into fields as if they were a keyboard, they have to be interrogated as a low-level hardware device.

  • Using CFHTTP to call a web service

    We are using a CF5 server, and will not be updating to MX any
    time soon. I need to call a web service, and understand I can do
    this with CFHTTP. Can anyone direct me to any docs or give me
    examples of how to do this?

    Answered my own question. The problem I had was returning
    complex datatypes. CFHTTP.FILECONTENT actually comes back as WDDX
    from an MX web service, so I was able to use the CFWDDX tag to turn
    a Soap structure into a CF structure, and it works
    perfectly.

Maybe you are looking for