Is there a way in the lookup or API of the Data Repository to order results?
i.e. Presuming that %{CustomerID} is set above this:
lookup(OrderDetails, OrderNumber, CustomerID, ‘%{CustomerID}’)
I want to order by DESC but instead I just get the first match.
Please advise.
I figured this out using the API. Though better than removing the post, I’ll put down how I did it - might come in useful for another:
Dim RepoObject
Dim MyKeySet
Dim sCustomerID
sCustomerID = Watch.GetVariable("CustomerID")
Set RepoObject = CreateObject("RepositoryLib.WorkflowRepository")
MyKeySet = RepoObject.GetKeySets("OrderDetails", "[""OrderNumber"",""Date"",""Time""]", "CustomerID='" & sCustomerID & "'")
Watch.SetVariable "JSONResult", MyKeySet
Watch.Log MyKeySet, 2
Now I have the resultset, I just need to sort it.
Hope this helps someone.
1 Like