Forum Discussion

kgroneman's avatar
5 years ago

Why is this not pulling all data?

I'm using this bit of code I got from tolstoshev  to pull the information about who voted for ideas in a particular exchange.  My intent is to get all votes from a specific exchange.  Some of the exchanges have hundreds of ideas (and votes):

<hr>
<h3>Copy the below to a text file then open with Excel as a comma delimited csv file</h3>
<hr>
<#assign roles = restadmin("/users/id/" + user.id?c + "/roles").roles.role>
<#assign roleSize = roles?size>
<#if (roleSize > 1) >
    <#list roles as role>
        <#assign roleName = role.name?trim />
        <#if roleName == "Micro Focus Employee">

 <#if config.getString("phase", "prod") == "prod">
 		<#assign board='OpsBridge_Idea_Exchange' />
 	<#else>
		<#assign board='Ideation' />
	</#if>
Idea Name, Submitter email, Voter email, Status, Day, Year, IdeaID, Label, URL

<#assign idea_obj = restadmin("2.0","/search?q=" + "Select * FROM messages WHERE board.id = '${board}' AND conversation.style='idea' AND depth=0"?url) />

<#list idea_obj.data.items as fubar>
   <#assign authoremail = restadmin("2.0","/search?q=" + "Select * FROM users WHERE id='${fubar.author.id}'"?url) />

  <#assign voters = restadmin("2.0","/search?q="+fubar.kudos.query?url) />
  <#list voters.data.items as uservotes>
     <#assign emailaddy = restadmin("2.0","/search?q=" + "Select * FROM users WHERE id='${uservotes.user.id}'"?url) />
     <#assign labels = restadmin("2.0","/search?q=" + "Select * FROM labels WHERE messages.id = '${fubar.id}'"?url) />
     <#assign firstlabel = "missing label">
     <#attempt>
         <#assign firstlabel = labels.data.items[0].text />
         <#recover>
     </#attempt>
<br>${fubar.subject},${authoremail.data.items[0].email},${emailaddy.data.items[0].email},${fubar.status.key},${fubar.post_time?date},${fubar.id},${firstlabel},http://community.microfocus.com${fubar.view_href}
  </#list>
</#list>


        </#if>
    </#list>
</#if>

 It works great, except it only pulls a small portion of the data before it stops.  Sometimes 20 lines, 40 lines, 57 lines, whatever.   Refreshing always shows the same amount. Why? 

My questions:

  • This is in a custom text box.  Is there a limit to what a custom text box can display? (If so, is there a way to make it output to csv?  (I'm not a developer)
  • Is there a limit to what the API call can return?  
  • Is there some unseen parameter making it only pull some specific data?
  • Is there some other sort of limit I'm running into?

Thanks in advance for any advice.  

No RepliesBe the first to reply