How to merge a field with Negative value

  • 1
  • Question
  • Updated 4 years ago
  • Answered
  • (Edited)
I have added 'Create New row in Model' action and i want add default value of Price field with Negative value of another field , how i can Merge that Negative value?

UnitPrice__c = {{$Model.Product2Id.data.0.UnitPrice}}

I want to assign Negative value of Product unit price.
Photo of Reddy

Reddy

  • 182 Points 100 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Josh Cutler

Josh Cutler, Official Rep

  • 864 Points 500 badge 2x thumb
It looks you are trying to use sub-action, Add Default Value, to the action, Create new row in Model. It's clever that you are trying to use Merge Syntax to bring in the first value of the Product object, but it won't do "maths" for us, so we can't get the negative unit price by adding a default value.

I think the best approach would be to add a Formula field on the object that hosts the UnitPrice__c field. I made a formula, UnitPrice__1 * -1, that did the trick for me. Then you can reference this field when you create a default value.

Let us know if you have something different in mind.

Good luck!

-Josh
Photo of Reddy

Reddy

  • 182 Points 100 badge 2x thumb
Josh,

Thanks for your approaches. In the above scenario i have used snippet to take the negative value from the field.