Getting a similar error when I put that as the return value:
'string[]' does not contain a definition for 'FirstOrDefault' and no accessible extension method 'FirstOrDefault' accepting a first argument of type 'string[]' could be found (are you missing a directive or an assembly reference?)
I just used copy and paste to throw it into the script, here's the full script:
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;
namespace Scripts
{
public class test : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
IEntitySessionResult result = (IEntitySessionResult) value;
Spreadsheet sheet = item.Theme.Spreadsheets.Find("TESTING CSV.csv");
var check = sheet.FindRow(result.Entity.CurrentDriver.Id.ToString());
var row = sheet.FindRow(result.Entity.CurrentDriver.Id.ToString());
if (check != null)
{
var name = row[1];
return name;
}
return result.Entity.CurrentDriver.Name.Split(' ').FirstOrDefault();
}
}
}