Signature

global static List<String> getResourceProperty(
  List<Types.GetResourcePropertyInput> inputs,
  String runAs
)
Parameters
ParameterDescription
inputs requiredOne entry per property to read. Each Types.GetResourcePropertyInput names a resource and the property to read from it.
runAs
String
optionalEmail Id of the user on whose behalf the function should run. To run the action as the automation user, supply integrationUser.

Return Type

List<String>. One value per input, in the same order as the inputs. Text, boolean and number values are returned as text. If the resource does not have the property, the value is an empty string. If the property holds an object or a list, the value is null.

Example

cldfs.Resource resource = new cldfs.Resource(
  '01KEHAKUXCQ6YIOFLOPJHJN57Y5EYQTJMZ', // resource Id
  'file', // file or folder
  null, // name
  'sharepoint', // library
  'b!nJBtPq_z5UeJtFrj_f24XEQqlPUD8vtFsg7GBcrXJepiUn9bkb_7QbDPtqHVD-cP' // drive Id
);

List<cldfs.Types.GetResourcePropertyInput> inputs = new List<cldfs.Types.GetResourcePropertyInput>{
  new cldfs.Types.GetResourcePropertyInput(resource, 'name'),
  new cldfs.Types.GetResourcePropertyInput(resource, 'description')
};

List<String> values = cldfs.Client.getResourceProperty(inputs, 'integrationUser');
String name = values[0];
String description = values[1];
Read several properties in one callEach resource is fetched once per call, so reading several properties of the same file in one call costs the same as reading one. To change a property, use Set Resource Property.
TestingUse ClientFactory with default mock values to get coverage without callouts. See How to get test coverage of code that uses Client methods.