Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fatih Yener 3 posts 73 karma points
    Mar 26, 2019 @ 19:27
    Fatih Yener
    0

    Umbraco Forms, post as XML

    Hello there, i have been trying to set up umbraco forms to post submitted data to Zoho Recruit as XML.

    I can successfuly send data to recruit by simply going to url with the format below;

     https://recruit.zoho.com/recruit/private/xml/Candidates/addRecords?authtoken=apikey&scope=recruitapi&xmlData=
     <Candidates>
         <row no="1">
             <FL val="Source">Umbraco Forms</FL>
             <FL val="First Name">Name</FL>
             <FL val="Last Name">Surname</FL>
             <FL val="Email">[email protected]</FL>
         </row>
      </Candidates>
    

    However i couldn't get umbraco forms to work.

    I add this to my URL field; https://recruit.zoho.com/recruit/private/xml/Candidates/addRecords?authtoken=apikey&scope=recruitapi&xmlData=

    And my workflow setup looks like this;

    enter image description here

    There's this "XsltFile" option, I have no idea how the XSLT must be set up to get an xml format like this;

    <Candidates>
    <row no="1">
    <FL val="Source">Umbraco Forms</FL>
    <FL val="First Name">Anna</FL>
    <FL val="Last Name">Smith</FL>
    <FL val="Email">[email protected]</FL>
    </row>
    </Candidates>
    

    Any help would be very much appreciated. Thank you.

  • Fatih Yener 3 posts 73 karma points
    Mar 27, 2019 @ 05:43
    Fatih Yener
    0

    Update: I created an xslt file and added it onto workflow, but i still get errors that i can't find any relevant solution online;

    Down below is the XSLT code;

        <?xml version="1.0" encoding="UTF-8"?>
     <xsl:template match="/Candidates">
    <html>
    <body>
        <xsl:for-each select="row">
            <xsl:value-of select="First Name" />    
            <xsl:value-of select="Last Name" />
            <xsl:value-of select="Email" />
        </xsl:for-each>
    </body>
    </html>
    </xsl:template>
    

    Error Message;

    Form workflow 'Zoho XML' failed on 'Submitted' of Record with Unique ID 'ae24e361-c1c8-4308-8600-926bf9c0786d' from the Form named 'Contact form' with Unique ID '47e698a5-36b3-4998-878d-784177a25e7d'
    System.ArgumentException: Specified value has invalid HTTP Header characters.
    Parameter name: name
       at System.Net.WebHeaderCollection.CheckBadChars(String name, Boolean isHeaderValue)
       at System.Net.WebHeaderCollection.Add(String name, String value)
       at System.Collections.Specialized.NameValueCollection.Add(NameValueCollection c)
       at Umbraco.Forms.Core.Providers.WorkflowTypes.PostAsXml.Execute(Record record, RecordEventArgs e)
       at Umbraco.Forms.Core.WorkflowType.ExecuteWorkflow(Record record, RecordEventArgs e, Workflow workflow)
       at Umbraco.Forms.Core.Services.WorkflowService.ExecuteWorkflows(List`1 workflows, RecordEventArgs e)
    

    There is no "name" field in the form, i've tried changing field names in the XSLT to original aliases of form fields (Instead of First Name, i used firstName, et cetera.) Still no luck. Stuck with the same error.

Please Sign in or register to post replies

Write your reply to:

Draft