basepath = 'G:\Shared drives\Carbon Group\Spray Documents';
filename = 'Deployment_Log.xlsx';
file = fullfile(basepath,filename);
deplog = readtable(file);

SNs = deplog(deplog.GliderID == 34,:); % Get all matching SNs directly
SNs = SNs(end,:); % Get the last one

optodeSN = SNs.optodeSN;
fluorometerSN = SNs.fluorometerSN;
ctdSN = SNs.CTDSN;
pumpSN = SNs.pumpSN;
pHsensorID = SNs.DSD_ID;

%%
if isnan(SNs.optodeSN)
    SNs.optodeSN = 'unknown';
end
if isnan(SNs.fluorometerSN)
    SNs.fluorometerSN = 'unknown';
end
if isnan(SNs.CTDSN)
    SNs.CTDSN = 'unknown';
end
if isnan(SNs.pumpSN)
    SNs.pumpSN = 'unknown';
end



app.DoxyEditField.Value = char(SNs.optodeSN);
app.FluorometerEditField.Value = char(SNs.fluorometerSN);
app.CTDEditField.Value = char(SNs.CTDSN);
% pumpSN = char(SNs.pumpSN); % add this
app.pHSensorIDEditField.Value = char(SNs.DSD_ID);