Retrieving SharePoint lookup data based on a form field selection - InfoPath Dev
in

InfoPath Dev

Retrieving SharePoint lookup data based on a form field selection

Last post 01-11-2012 01:42 AM by dw999. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-10-2012 01:55 PM

    • dw999
    • Not Ranked
    • Joined on 01-10-2012
    • Posts 6

    Retrieving SharePoint lookup data based on a form field selection

    Hi,

    Had a search for this but couldn't quite find what I was looking for, so apologies if this has been previously answered.

    Using IP2010, I have a standard SharePoint list data connection to a list which looks like this:

    TitleLowMediumHigh
    Threshold A
    0.1 0.3 0.5
    Threshold B
    0.2 0.7 1.0
    Threshold C
    3 6 10.0

     In my form, I want to allow a user to enter a number for each threshold, a modifier (i.e. L,M,H) and for the form to multiply the two numbers together. E.g.


    ValueModifierResult
    Threshold A

    [NUMBER FIELD]

    e.g. 10

    [DROPDOWN FIELD] - contains Low, Medium, High

    e.g. Medium

    [CALCULATED FIELD] - Value * Matching

    Modifier against the lookup for Threshold A

    (e.g. 10 * 0.3 = 3)

    I can filter the List Data Source to get the Threshold A values but I can't figure out how to then return the value of the column that matches the name selected in the Modifier dropdown (i.e. Low/Medium/High)?

    i.e. xdXDocument:GetDOM("Thresholds")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Title = "Threshold A"] gets my the whole row in the list but I want dynamically retrieve the specific column - something like "xdXDocument:GetDOM("Thresholds")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Title = "Threshold A"]/d:[VALUE OF DROPDOWN]"

    Thanks!

    p.s. I'm looking for a no-code-behind solution


  • 01-10-2012 09:06 PM In reply to

    Re: Retrieving SharePoint lookup data based on a form field selection

    Hi dw999,

    May I ask how do you identify if a number entered belongs to Threshold A, B, or C? For example, does 1-10 belongs to A? And what's greater than 10 belongs to B and so on..?

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 01-11-2012 12:36 AM In reply to

    • dw999
    • Not Ranked
    • Joined on 01-10-2012
    • Posts 6

    Re: Retrieving SharePoint lookup data based on a form field selection

     Hi Jo-Anne,

     There's no relationship between the numbers the user enters - e.g. they could enter 10 for Threshold A,B and C and select Low for each

     Thanks

  • 01-11-2012 01:24 AM In reply to

    Re: Retrieving SharePoint lookup data based on a form field selection

    Can you try adding a rule in your dropdown that sets your Results field with a value like ../my:ThresholdA * xdXDocument:GetDOM("Thresholds")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Low (where ThresholdA is your text field for entering "A" thresholds), add a condition if Modifier = "Low". Then create the same rule for "Medium" and "High". See if that works.

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 01-11-2012 01:42 AM In reply to

    • dw999
    • Not Ranked
    • Joined on 01-10-2012
    • Posts 6

    Re: Retrieving SharePoint lookup data based on a form field selection

    Ahhh, yes, that would work that way. Thanks!

    Does that imply that it's not possible to dynamically reference a field at runtime by it's name without code? e.g. "xdXDocument:GetDOM("Thresholds")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:" + ../myThresholdAModifier

    (Similar to the Javascript eval function)

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.