Trying to show data via function using custom related list - what's wrong with my formatting?
Hi,
Sent this in via live chat but haven't gotten a response yet, and wondering what I'm doing wrong.
I have this code:
- string FreshdeskTickets(string email)
- {
- headerMap={ "Content-Type" : "application/xml", "Authorization" : "Basic XXXXX" };
- response = getUrl("https://XXXXX.freshdesk.com/helpdesk/tickets/user_ticket.xml?email=" + input.email,headerMap);
- ticketid = response.executeXPath("/helpdesk-tickets/helpdesk-ticket/display-id/text()");
- createdate = response.executeXPath("/helpdesk-tickets/helpdesk-ticket/created-at/text()");
- ticketsubject = response.executeXPath("/helpdesk-tickets/helpdesk-ticket/subject/text()");
- lastupdated = response.executeXPath("/helpdesk-tickets/helpdesk-ticket/updated-at/text()");
- weburl="https://edgeassessment.freshdesk.com/helpdesk/tickets/" + ticketid;
- items=weburl + "" + ticketid + "" + createdate + "" + ticketsubject + "" + lastupdated;
- return items;
- }
And in the script testing, it does show the data from the API call as coming in successfully. I just can't get it to show up in the related list itself ("
Sorry, the related list cannot be displayed as there is some problem while processing your request.")
, and I think it's a formatting issue on my part somewhere. I looked up from elsewhere the format, which should be something like <record><row no=0><FL name="item1">Item data</FL></row></record>, so then I tried another basic function that looks like this:
- string helloworld(string email)
- {
- return "<row no=\"0\"> <FL val=\"Name1\">value1</FL> <FL val=\"Name2\">value2</FL> <FL val=\"Name3\">value3</FL> <FL val=\"Name4\">value4</FL> <FL val=\"Name5\">value5</FL> </row> <row no=\"1\"> <FL val=\"Name1\">value1</FL> <FL val=\"Name2\">value2</FL> <FL val=\"Name3\">value3</FL> <FL val=\"Name4\">value4</FL> <FL val=\"Name5\">value5</FL> </row>";
- }
But same error. What am I doing wrong?