Sorting UBAQ by Calculated field populated by UBAQ BPM

Hello,

I’m trying to sort a BAQ based on a calculated field that I’m populating values for in a post processing BPM on GetList in the UBAQ. I’m creating rows in ttResult which need to appear in a certain order. Any sort I have in the BAQ doesn’t work since the values are being set after the BAQ runs. Is there a way I can add a line of code that will sort the BAQ, after these values have been set?

I’ve tried using a lambda expression ttResults.OrderBy(x=>x.CalculatedField) but haven’t gotten it to work.

curious. Why isn’t the calculated field apart of the BAQ query?

2 Likes

@knash It is part of the query for the rows that are there already, but in the BPM I’m adding rows and setting the calculated field value through the BPM. After the BPM runs all the added rows are added to the bottom and I have to manually sort that calculated field to get them to show up in the correct order.
This is the order after running the BAQ
image

This is the order they should be in
image

Think that calculated field could be apart of the query? Not many things you cannot do in the BAQ.

1 Like

Unfortunately no, I don’t know the order they should be in until the BPM runs.

Lets start with the rows being added. What is the logic there?

I know this is not the answer you are looking for, so you don’t have to go down this rabbit hole with me. This feels like something that the BAQ can do all at one. without the BPM.

1 Like

Yeah at this point I’m looking to see if there’s a line of code I can throw at the end of the BPM to get it sorted correctly. I can manually sort in the Dashboard and save the layout but just seemed like I was close.