Archive

Archive for January 19, 2022

Power Apps | Business Rule | Set Field Value vs Set Default Value

January 19, 2022 2 comments

While configuring Business Rules you might have noticed ‘Set Field Value’ and ‘Set Default Value’ Actions.

Though the ‘Set Field Value’ and ‘Set Default Value’ Actions look identical, there are following subtle differences.

Set Default Value:

  • ‘Set Default Value’ only triggers on ‘Create’ event and does not trigger on ‘Update’.
  • To understand this better lets go with an example, I’ve a ‘Student’ table with ‘Department’ and ‘College Fee’ columns.
  • In my ‘Business Rule’, I am setting ‘College Fee’ field value to ‘10000’ using ‘Set Default Value’, when the ‘Department’ sets to ‘IT’.
  • Now in my App, on Student’s ‘Create‘ form, the ‘College Fee’ field sets to ‘10000’ when the Department is IT as configured in Business Rule.
  • If I open an Existing ‘Student’ record, and set the ‘Department’ to ‘IT’, ‘College Fee’ field will not get set to ‘10000’, which proves that ‘Set Default Value’ action defined in ‘Business Rule’ does not trigger on ‘Update’ event.
  • One more key point is, ‘Set Default Value’ can’t override an existing field value.
    • For example, on ‘Student’ create form, manually type some value in ‘College Fee’ and then change the ‘Department’ to ‘IT’ .
    • This triggers ‘Set Default Value’ action, but the ‘College Fee’ value wont get changed to 10000 as there was already a manually typed presented in ‘College Fee’.
  • Also, ‘Set Default Value’ does not have ‘Clear’ option.

Set Field Value:

  • ‘Set Field Value’ triggers on both ‘Create’ and ‘Update’ of the record.
  • Also, ‘Set Field Value’ has a ‘Clear’ option.

Hope these differences helps you while choosing between ‘Set Default Value’ and ‘Set Field Value’,

🙂