Today there is no way to set an Asset of the type String to empty in the orchestrator.
I think this should be possible since it is possible in VB.Net and C#.
Imagine this scenario:
I have a reportingtool that is run monthly that has an Asset with a configuration for the reports it should create from the Orchestrator Api.
This Asset is called JobConfiguration, it defines ALL reports.
But I want to be able to experiment, or generate reports whenever, maybe not all regular reports or create a new report.
For this need I created another Asset called TestJobConfiguration. In this configuration I can put configurations I want to test or run manually.
The in the code I put an If that checks String.IsNullOrEmpty(TestJobConfig) and if it contains anything the reportingtool should use the TestJobConfig when it runs.
Looks good doesn’t it? But there is a problem…
The problem is that I can’t set the TestJobConfig Asset to empty. I have to set it to something so first reaction is to set it to “”. But that naturaly results i the variable holding the Asset-value will contain “""”.
Workaround is do this in the If: TestJobConfig.Length < 3.
SUGGESTION:
It should be possible to have empty values in Assets, maybe with a simple checkbox like this: “Allow Empty Values ”
Yes that is a variant, but if someone misspells it? “N/S” for exampel?
Another workaround is to have a Boolean Asset as a flag if I want to use the TestConfiguration, and then I can just check if flag is true or false in code.
But since an Asset is a String it should be possible to set it to empty since that is a default value in VB.Net and C#.
(Edit: A default string in VB.Net is Nothing and in C# it is null.)
UI most likely trims the value, so whitespace only ends with being empty, and therefore considered an invalid value. WIth API the expectation is for the sender to know what they’re doing, so altering the value would break trust.
A single space is also not empty, although it would be effectively the same when used with string.IsNullOrWhiteSpace(assetValue)