UBAQ Results count coming up with unexpected numbers

Hello all, I found my main answer from @NateS here:

but I’m getting something strange. The whole story is long but I’ve narrowed it down to this:

  1. A UBAQ based on this
    https://www.epiusers.help/t/tutorial-using-a-ud-table-as-a-temp-table-for-external-or-generated-data-to-link-with-sql/98902

  2. is called by a dashboard with “Uptake from Excel” in use, by allowing the UBAQ to add records.

  3. I had to use advanced BOM update only, and had to put it as ##BASE##

  4. I can successfully uptake from Excel and save in a UD table (I’m using UD08, so standalone not parent/child). I can also lookup data elsewhere and save it in my UD08 record

  5. Everything I do based on this trigger has extra records. Finally, I went to the lowest level I could:

var qResults = queryResultDataset.Results.Where(x => x.Unchanged() );
    int vins = qResults.Count();

And despite my spreadsheet having 8 records, vins.ToString() == 18

Anyone run into this before?

OK, interesting, if I loop through the results I see every second row has RowMod = “U”

Correct. That way you can compare what was updated. The unchanged row and the changed one.

Saves you from having to use the DB.

2 Likes

OK, got it. Wasn’t a very bright question but I’m going to store it here anyhow, because in 2025 I’ll probably need it again and search these august halls of knowledge.

I can now import this into my dashboard:

image

Use this to parse it out and act on it in a BPM, Efx, SQL, etc.

    List<string> vinList = new List<string>();
    
    vinList = (from vinRow in queryResultDataset.Results.Where(x => x.Unchanged()) select vinRow.UD08_Key1).ToList();
    
    int lt = vinList.Count;

    for(int q = 0; q < lt; q++)
    {
      dbg += vinList[q].ToString() + Environment.NewLine;
    }

And get this in an output place:

image

Good times.

Perfectly acceptable question.