Matt Immer
Matt Immer

Reputation: 509

Business rule: Add other field value to date?

I'm trying to programmatically set the Due Date field of a custom activity. I want take the value of another date-time field that the users enters and add the value from an integer field. But it seems that I can only select a static value to add using the business rules as shown here:

Field Value

Is there a way to do it using business rules? Or do I have to use a Javascript instead?

Upvotes: 0

Views: 1086

Answers (2)

SeaDude
SeaDude

Reputation: 4385

This should be quite easy using PowerApps expression language; no need for PowerApps "Rules" (which are slated to be deprecated).

To your app:

  1. Add a DatePicker control
  2. Add a TextBox control
  3. Add a Label control

Set the Label control's Text property to:

DateAdd(
    DatePicker.Selected.Value, 
    Value(TextBox.Text), 
    Days
)

Bingo! enter image description here

Upvotes: 0

You can use calculated field for these scenarios, but it is not a physical field to store. If you have to store the value, then Javascript or plugin or WF is better.

Business rules are limited in these situations.

Upvotes: 1

Related Questions