In a really simple component(rule), doing a "Calculate a value" action does not make the "Result" variable available to any other actions, even with simple hard-coded results. Am I doing something wrong?

Comments

VladimirAus’s picture

Component: Rules Core » Rules Engine

I have the same issue.
That's because calculate is decimal value and I'm trying to set it to Integer.
Is there way around it?

guy_schneerson’s picture

i am using it with two decimal values and a (-) operation
i can use the result in the data selector of the next action (by selecting it from the dropdown).
hope this helps.

mudds’s picture

Thank you guy schneerson.

I had the same problem and that helped.

Lloyd’s picture

I think this is related. I have an action to Calculate a value. I've entered a variable name to use. i then want to create an additional action to put the calculated value into a data field.

I create the new action called Set a Data Value. I select the field that I want the variable to be stored into. But I cannot select the variable as the data to be stored in the field.

Anonymous’s picture

You might want to try the new type conversion actions, see current dev-release.

mitchell’s picture

I started a section in the handbook on Data calculations, conversions, & transformations. It's very early in development, so if you'd like to work the info here and some of your experiences into that section, by all means, make any changes you like. Thanks!

sreekanth1201’s picture

Hi,

I have a non shippable product with price $15..I need docs from the customer.I arranged a pickup facility for my customer that charges more $3.When enables the pickup facility the charge will be 15+3=$18.

I tried above above use case using rules, by following

1)event - "before saving the cart item"
2)condition - "Entity has field pick up"

In action i am looking for price in the dataselector so that i can add $3 to the price.But i couldn't able find my custom content types.

TR’s picture

Component: Rules Engine » Rules Core
Category: Bug report » Support request
Issue summary: View changes
Status: Active » Closed (works as designed)

@guy_schneerson gave the solution. Be aware that the data selector will only show values where the type matches what is required for the input. So if your calculated value is an integer and you are trying to use that as text input, then you will have to convert the data type first as mentioned by @Shnapoo. Alternatively, you can use direct input instead of the data selector, and use the token for the calculation result.