You are viewing limited content. For full access, please sign in.

Question

Question

Limit amount of search results

asked on May 28, 2020

I'm currently working on an API to locate certain documents based on a search syntax and then move the documents to a given route, one of the functions is that the requester should type the number of entries he is willing to search, I know you can do that in workflow with the "Search in Repository" activity. Which method can help me with this need I have?  

 

1 0

Answer

SELECTED ANSWER
replied on May 28, 2020

You can retrieve the search results and stop after the desired number of rows. Some sample code can be found in this post. On line 8, you would do something like this:

maxRowsToReturn = 100;
for (int rowIndex = 0; rowIndex < Math.Min(listing.RowCount, maxRowsToReturn); rowIndex++)

 

1 0
replied on May 28, 2020

Ok, it works for me, thank you.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.