Using Dynamic Spreadsheet bindings to sort

Posts: 38
I am wanting to add team information to the dynamic spreadsheet which I have working.

How would I call that into a script?

Thanks,
Harold
Posts: 287
No need script for that.
Import spreedsheet with column 0 as iD iRacing, insert in other what you want. You have to put Sort Column index to 0 in DATA setting of Spreadsheet.
Then you select in Data of your Label the good column of your Sreadsheet as data.
Posts: 38
I am wanting to call team from the Dynamic Spreadsheet so I can have a sort for a single team.

Not sure how to call a field from the spreadsheet and do a Data Set from that call out.

Thanks,
Harold
Posts: 287
If you select for exemple a widget with DATA SET Followed. Then in your Label you can select for data each column of your Spreadsheet (on the bottum of the selection area).
So if your driver followed get the ID 123456 and if your Spreadsheet is for exemple 123456,TEAM ATVO --> your label will indicate TEAM ATVO
Posts: 287
Look on my theme for FUNYO, under pilot name you can see their TEAM NAME not from iRacing but from Spreadsheet.

LINK
Posts: 38
Emmanuel,

I got how to use the Dynamic Spreadsheet field.

I want to have a Custom Data Set based on Team.

Meaning team = "ABCD" are the only drivers in the Data Set.

I know how to sort and exclude items that are in ATVO but how do I being in the "Team field" from a Dynamic Spreadsheet?

Thanks,
Harold
Posts: 38
Not really.

I am looking at creating a Custom Data Set using the Team Name Field in my Spreadsheet.

I just need to know how to call in that field into the script.

Thanks,
Harold
Posts: 785
It sounds like you know how to create a custom dataset that applies a custom filter, but you don't know how to get the data to filter with. Right?

I think there are few ways to solve this, but unfortunately there is no way to access the theme (and its spreadsheets) from a custom dataset at the moment. That is something I have to add in a new build.


Once I do that, then something like this could work:

Option 1: get the team names of every driver from the spreadsheet, then return only those with matching team name
In the Filter method of the custom dataset you get a list of all results (IEntitySessionResult). You could do a loop over all results and find the teamname of each result via the spreadsheet "GetBindingData" method. That returns the data of one specific column for one specific driver. Repeat that in a loop for all results and keep building a list of matching results as you go along. In the end just return that list.


Option 2: get the drivers/results that match a given teamname, and filter the list of all results based on that
Perhaps better for performance: you can also get a list of rows from a spreadsheet that match a given input on a specific column. For example you can request a list of rows where column 4 has "YourTeamName". Then, you can use the identifier in that column (typically column 0) to match back to your results. For example if your identifier is CustomerId then you can filter the list of results based on the customer Ids that you get in your matching rows.
Posts: 62
If i could partially hijack this thread, as it answers part of what I want (being able to sort based on the column of an imported spreadsheet), but I also want to be able to dynamically update a value in another column based on the sort. Here's what I mean:

- I have an ATVO overlay for Custom League Driver Standings.
- I have standings.csv that I import into the theme with the Columns "Rank", "Driver", "Points"

Right now, I have all of those values hard-coded, but now that I know I can sort based on points, that solves one problem of putting the ranking in the right order.

However, my rank numbers are currently hard-coded in the spreadsheet. What's the easiest way to have the Rank # update automatically to follow the new sort order?

Thanks!