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.
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
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.
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?