In case things varying depending on "Department" are just some textual phrases:
Using a LaTeX-distro which is up to date you can maintain a property list for each department via expl3/xparse:
\documentclass{article}
%=========================================================================================
\RequirePackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand\Departments {m} {
\keyval_parse:NNn __MYPREAMBLECODE_prop_const_from_keyval:n __MYPREAMBLECODE_prop_const_from_keyval:nn {#1}
}
\NewDocumentCommand\Department {m} {
\prop_if_exist:cF {\MYPREAMBLECODE_DepartmentPropertiesPrefix: #1}
{ % An error about unknown Department/unknown property list:
\msg_error:nnx {MYPREAMBLECODE} {UndefinedDepartment} {#1}
}
\cs_gset:Npx __MYPREAMBLECODE_SelectedDepartment: {\MYPREAMBLECODE_DepartmentPropertiesPrefix: #1}
}
\msg_new:nnnn {MYPREAMBLECODE}
{UndefinedDepartment}
{\token_to_str:N\Department:\ No\ properties\ defined\ for\ Department\ `\tl_to_str:n{#1}'\ \msg_line_context: .}
{Use\ the\ command\ \token_to_str:N\Departments\ for\ specifying\ properties\ of\ Departments. }
\prop_gput:Nnn \g_msg_module_type_prop { MYPREAMBLECODE } {}
\prop_gput:Nnn \g_msg_module_name_prop { MYPREAMBLECODE } {Preamble-Code}
\NewDocumentCommand\GetSelectedDepartmentsPropertyValue{mm}{
% #1 = property
% #2 = tokens in case property is not defined
% Reasons could be:
% 1. property is not defined for the selected department.
% 2. selected department is not defined.
% 3. \Departments or \Department was not called.
% Could be a warning/error-message and/or some
% default-value.
\prop_if_exist:cTF __MYPREAMBLECODE_SelectedDepartment: {
\prop_if_in:cnTF __MYPREAMBLECODE_SelectedDepartment:
{#1}
{ \prop_item:cn __MYPREAMBLECODE_SelectedDepartment: {#1} }
}{\use:n}{#2}
}
\cs_new:Nn __MYPREAMBLECODE_prop_const_from_keyval:n {
__MYPREAMBLECODE_prop_const_from_keyval:nn {#1}{}
}
\cs_new:Nn __MYPREAMBLECODE_prop_const_from_keyval:nn {
\prop_const_from_keyval:cn {\MYPREAMBLECODE_DepartmentPropertiesPrefix: #1} {#2}
}
\cs_new:Nn __MYPREAMBLECODE_SelectedDepartment: {}
\cs_new:Nn \MYPREAMBLECODE_DepartmentPropertiesPrefix: {Department:}
\ExplSyntaxOff
%=========================================================================================
\Departments{
FOO={
Property1=FOO---Property1's value,
Property2=FOO---Property2's value,
Property3=FOO---Property3's value
},
BAR={
Property1=BAR---Property1's value,
Property2=BAR---Property2's value,
Property3=BAR---Property3's value
},
FOOBAR={
Property1=FOOBAR---Property1's value,
Property2=FOOBAR---Property2's value,
Property3=FOOBAR---Property3's value
},
\empty={
Property1=[Nameless Department]---Property1's value,
Property2=[Nameless Department]---Property2's value,
Property3=[Nameless Department]---Property3's value
},
}
\Department{FOO}
%\Department{BAR}
%\Department{FOOBAR}
%\Department{}
%\Department{FOOL}
\begin{document}
\GetSelectedDepartmentsPropertyValue{Property1}{\textsf{??}}
\GetSelectedDepartmentsPropertyValue{Property2}{\textsf{??}}
\GetSelectedDepartmentsPropertyValue{Property3}{\textsf{??}}
\GetSelectedDepartmentsPropertyValue{Property4}{\textsf{??}} % Property 4 is undefined with the selected department, therefore: ??
\end{document}
(With \Department{FOO} respective \Department{BAR} respective \Department{FOOBAR} the command \GetSelectedDepartmentsPropertyValue yields phrases defined for these departments.
With \Department{} and \Department{\empty} the command \GetSelectedDepartmentsPropertyValue yields phrases defined for the nameless department.
With \Department{FOOL} the command \GetSelectedDepartmentsPropertyValue for reason 2 always yields ⟨tokens in case property is not defined⟩.)