Filtering with conditions - InfoPath Dev
in

InfoPath Dev

Filtering with conditions

Last post 10-03-2005 09:52 AM by tatopitta. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-30-2005 09:10 AM

    Filtering with conditions

    Hi all!
    How many interesting topics are here!Anyway, here's mine:
    I have in a row of a repeating table four dropdown linked together so that if a user sets a value in the first, the second is populated on the basis of the inserted value in the first; the third is populated on the basis of the second and the last on the basis of the third.
    It's quite simple and it works. Now my project manager (may God damn them (except the present ones!)!:))))) ) asks me to add a further feature: user can set the last value and automatically all others 3 values are set. Well...can anyone give me an idea to make my project manager happy?
    Well, even if my form is vey full of VBScript code, I think I need to add more code...any idea to avoid it? Using OnAfterChange might be possibile but i must express the filter used with VBScript...
    I think there's no problem to fill in the first, the second and the third dropdown on the basis of the last, but how can i do the opportunity to show all possibile values in the last dropdown when the others are empty (or to show all possible value in relation to the last no-empty dropdown)?I need to add a condition to the filter so that the last dropdown show the value related to the last no-empty dropdown?

    Thank u, every idea is, as usual, welcomed :)
  • 09-30-2005 11:47 AM In reply to

    Re: Filtering with conditions

    Well, being a college student currently taking Discrete Math II, I would say you've got a 4-dimensional set on your hands.

    AxAyAzAp{ xR0y and yR0z and zR0p -> (x,y,z,p) element of R }, where (a,b) element of R0 if a presents b as a choice

    A cool and easy (and also extremely scaleable) way to check the conditions of your set would be to create 4-dimensional boolean array where 1 dimension equals each subset of choices x,y,z, and p and you just mark true/false in each dimension. Anyway, sorry if I wasted your time, but I couldn't think of a quick way around your problem.

    ---------------
    Matt Faus
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 10-01-2005 12:56 AM In reply to

    Re: Filtering with conditions

    Sounds like you just need a reverse index. The problem with the last dropdown will be the number of items in it. But, anyway, just create a reverse index to set the others. You already have an index to allow cascading from 1 to 2 to 3 and 4. So, for 4, just create a flat index of the values that it corresponds to (you can use a secondary DOM for this) and use that to filter it.

    Or, you could just use some fancy XPath to look it up in your current index, but that would be much less performant and require some XPath trickery.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 10-02-2005 11:49 PM In reply to

    Re: Filtering with conditions

    Hi all!
    Thank u for your advices...well, i'm trying to solve the question: is there a way to set by code all possible values that a dropdown can take?I'm trying to have the following conditional filter:
    if ThirdDropDown is null, show all possibile values of the LastDropDown; else, show the values related to the LastDropDown value...if I needed to do this, I'd can use a rule to set the values of the first 3 dropdown...what a mess!
  • 10-03-2005 09:29 AM In reply to

    Re: Filtering with conditions

    Hi again,
    let me point out something about the datasource of the four dropdowns(called A,B,C and D): the relations between A, B, C and D are set by some fields in the form that are not shown to the final user and these values comes from the backend (sap and biztalk)...so i cannot change them or modify their structure.

    To simplify the question, I added a field in Infopath Form and a control (another dropdown E) associated to it: the dropdown contains all possible values and the users can choose one of these. After his choice, using Rules, all others dropdowns contain the correct values. I added also some controls to keep the data coherent. It works but there are some things that could work better:
    1- the dropdown A, B, C and D show the real values and not theirs display names...
    2- i cannot assign a value to the first drop down: it always assumes the first of possible values, and not the one I set to it...maybe becouse others are linked together...

    I know that it's quite difficult to explain...thank you for your always well-accepted suggestion!
  • 10-03-2005 09:52 AM In reply to

    Re: Filtering with conditions

    Hmmm....maybe I resolved the problem...now it's working...even if i had to add another variable with its control...but it's quite simple :)
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.