Hi,
You cannot do this directly in the “set field value” section in the rule.
If you want the ID to be generated on save, add a rule with the trigger “The form is saved”, and add “generateCustomID” in the “Run these functions / trigger these rules” field.
Then you add this to the Custom JS section:
function generateCustomID(){
var p = getFieldValue("ProgramType").charAt(0), id = spjs.dffs.data.thisItemID;
while(id.length < 4){
id = "0"+id
}
setFieldValue("IdNumber",p+"-"+id);
}
Please note that you must change the fieldname “ProgramType” and “IdNumber” to your own field names.
Let me know how this works out.
Alexander