How can I set up a custom client setting to tag a group of machines with a certain setting, such as a reg key with a value of “Xtype”. I want to use this so if they are a member of a certain group I can use the Run only when Client Settings matches client setting xyz.
setting "MyCustomSetting"="MyCustomValue" on "{now}" for client
I’ll comment everytime someone suggests this to help stop the habit. Using now can put you into situations where the setting overrides an existing setting that you didn’t mean to do as the action execution can be out of order. Always use the “action issue date” parameter which is in every action to make sure the original order is kept on the endpoint.
setting "MyCustomSetting"="MyCustomValue" on "{parameter "action issue date" of action}" for client
Thanks for the insight @AlanM!!
Hello!
This and AlanM’s recommendation fail in the Fixlet Debugger (my only known option for testing without taking a custom action), and all my efforts in search of a workaround have failed (Result = “Evaluation failed!”; what am I missing??
STATUS: Running action...
Command failed (Unimplemented command 'setting'.) setting "MyCustomSetting"="MyCustomValue" on "{now}" for client
--- Result ---
Evaluation failed!
What I’m actually going for (fails on setting the parameter):
parameter "time" = "{((preceding text of first match (regex "/2026") of it) & (first match (regex " \d+:\d+") of it) & " " & (last 2 of it as lowercase)) of ((format "{0}" + now) as string)}"
setting "MyCustomSetting"="MyCustomValue & parameter "time" of action" on "{parameter "action issue date" of action}" for client
I’m trying to create/set the value of a custom setting at the end of an action.
The problem is that your parameter has an unescaped curly brace in it so that relevance substitution will fail and so will the setting command. Easy fix though… just double up on the trailing brace.
parameter "time" = "{((preceding text of first match (regex "/2026") of it) & (first match (regex " \d+:\d+") of it) & " " & (last 2 of it as lowercase)) of ((format "{0}}" + now) as string)}"
Next you need to make an adjustment to the setting command. Wrap the parameter in braces and your custom value in quotes and then the entire thing with curly braces to allow the substitution to run. There are other ways to do it but its just a matter of personal touch at some point.
setting "MyCustomSetting"="{"MyCustomValue" & (parameter "time" of action)}" on "{parameter "action issue date" of action}" for client
Thank you!!
Will we ever need to escape the opening curly braces?
Also, do you think I can use a similar method to append an existing value of the custom setting?
Yes; if you need to keep a literal { symbol in a string or command line and not evaluate as start of relevance statement. See Tip: Escaping curly brackets for substitutions in ActionScript for examples
Yes, you can add to existing client setting by embedding a relevance substitution into the new value.
I haven't tested and I'm using a phone now but you could try something like
setting "test"="{value of setting "test" of client | "empty"} appended string" on "{now}" for client
Thank you, I will test it out for sure!