Avatar of KoolAsIce
KoolAsIceFlag for Afghanistan

asked on 

how to compute values in chain

Hello experts,

Here is my senario, let's assume i have three controls. One is dropdown list which gets data from database. Then there is another control which is computed using some formula based on dropdown list value. Finally there is another control which is computed based off second control. This is just an example, mine is little more complex but this will give me a idea. Above senario can be reprensented as follows:  

Dropdown list (driven from database) => Control one computed based on drop down => Control two computed based on control one

I didn't find anything like label or anything in infopath. I am bit new to Infopath, please help.
     

Microsoft OfficeMicrosoft SharePointInfoPath

Avatar of undefined
Last Comment
nsyyoung
Avatar of Clay Fox
Clay Fox
Flag of United States of America image

To do this you often use the filter functionality.

So select a field where value equals the one chosen in the drop down.

Typically called cascading dropdowns.  You break down repeating data through subsequent selections.

www.infopathdev.com has some tutorials on cascading dropdowns.
Avatar of KoolAsIce
KoolAsIce
Flag of Afghanistan image

ASKER

Hi Clayfox,

thanks for your answer but I am not looking for a cascading dropdowns. Instead im looking for chain of computation.

For example, dropdown list data is coming from database. However, second control takes that data and does something like multiply that dropdown number with something. Finally there is another control which takes the value of second control and divides it by some number to yield a result for third control and so on.

Further, once data is populated in third control and now if the value of dropdown list is changed, then second control and third control value should change automatically.

Please let me know if you have any ideas.
Avatar of nsyyoung
nsyyoung
Flag of United States of America image

Hi Kool, try this:

If I want to multiply field 1 by 4 and divide that result by 3:

field1 is the dropdown value
field2 formula is field1 * 4
field3 formula is field2 / 3

Make sure there is a space on either side of the /, lest InfoPath consider it a separator instead of a division operator.

Does that help?
Avatar of KoolAsIce
KoolAsIce
Flag of Afghanistan image

ASKER

hi nsyyoung,

Thank you for your solution. I already did something like that using infopath control (fx). However, when I do so, once field1 dropdown value is changed after first computation, field2 and field3 doesn't seem to change automatically.

Also I am wondering, if I can use any other controls beside (fx) for chain computation like Label (but I didn't find any Label infopath :)  

 
ASKER CERTIFIED SOLUTION
Avatar of nsyyoung
nsyyoung
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft Office
Microsoft Office

Microsoft Office is an integrated suite of applications that includes Outlook, Word, Excel, Access, PowerPoint, Visio and InfoPath, along with a number of tools to assist in making the individual components work together. Coding within and between the projects is done in Visual Basic for Applications, known as VBA.

80K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo