Object reference not set to an instance

How can we extract variables.requested_by value into excel ?which kind of data type need to use in build table?


1 Like

Hey @avnreddy007

The requirement is not fully clear please…

Are you getting XML and you want to convert that into a Data Table



<short_description>Return - CTT Process Manager � EURLA</short_description>

<variables.requested_by>Annapureddy Venkatanarayanareddy</variables.requested_by>


<assignment_group>R&D Clin-Med</assignment_group>


Application Name = PharmaCM = CTT Process Manager � EURLA (RETURN/REMOVE Entitlement) = CTT Process Manager



<variables.customer>Shivraj Kote</variables.customer>






<work_notes>04-05-2022 11:17:57 AM - Kiran Jyothikumar Lathika Devi (Work notes) test notes </work_notes>

<variables.title>Return - CTT Process Manager � EURLA</variables.title>


this is my response, i need to store<variables.customer>value into excel. Could you please help on this

1 Like

Hey @avnreddy007

Since you are saying it’s just for only one field, we can go with string manipulation…

str_XML.Substring(str_XML.IndexOf("<variables.customer>"), str_XML.IndexOf("</variables.customer>") - str_XML.IndexOf("<variables.customer>"))

There may be some adjustments required since there is a tradeoff in index function, please try once and let know

Hope this helps


could you please help me out how to map <variables.customer> value in Build data table?
Which kind of data type we need to use and which kind of code need to include in assign value?

1 Like

Hey @avnreddy007

Just keep the data type as string and in the assign you need to do the following,

dt.Rows(0)("ColName") = str_XML.Substring(str_XML.IndexOf("<variables.customer>"), str_XML.IndexOf("</variables.customer>") - str_XML.IndexOf("<variables.customer>"))

I’m assuming it’s just the first row & used 0 as row index above


Its throwing error?

I have assign data type customer data type as string in build data table and while assigning value:

data.Rows(RowCounter).Item(“Customer”)=str_XML.Substring(str_XML.IndexOf("<variables.customer>"), str_XML.IndexOf("</variables.customer>") - str_XML.IndexOf("<variables.customer>"))

its throwing error?

1 Like

What’s the error please…?

Also please replace the variables with originals as per your code… I just used dummy variable names for string and datatable

Find this attachment

we would recommend to process XML with XML Apis / Activities
Kindly note: XML snippets will be broken, when not using the format </> button from editor.

The best option would be:

  • provide the XML data as text file
  • provide an expected output sample / description

We are getting below response from service now api. i have extracted some values like<short_description>,but unable to extract <Variables.customer> value.

i have assign value for <Variables.customer> like


The element name is case sensitive. Have you tested to change "Variables.customer" to "variables.customer"?