0

I have data in table (some 500 rows). I need to fetch that data and store it somewhere. Later i want to find a row from that data and use it. In many flows i will be using this data to find some specific row. I need to know what is better to use. Fetch data and store in datastore and then when searching find it using find or get data and store in a PB structure and loop it over and find the row needed.

I would create a function to fetch data and one function to search data. this search data function will be called more than 100 times in one flow. So which is better approach to use?

Thanks

Mishti
  • 47
  • 6

1 Answers1

2

I'd use a datastore with the Find method. For one thing, it's much easier to debug. Just make sure the upper end of your find is greater than the number of items in the datastore ( like using ds.Rowcount + 1 or similar)

Matt Balent
  • 2,337
  • 2
  • 20
  • 23
  • I did not understand what you mean by upper end of find is greater than number of items in DS – Mishti Apr 07 '20 at 17:33
  • 2
    Beyond being easier it will be significantly faster. Never program something in PowerScript if there’s a native function that will do the job, if you care at all about performance. Matt’s reference to the “upper end of your find” refers to the parameter in the Find() function that defines the last row to search. (Although I’m assuming ascending search; technically you can search backward by putting the higher row number first, and the lower row number in the “last row to search” parameter place.) – Terry Apr 07 '20 at 18:23