Query list with multiple columns to return a specific value where column 1 provides key to return value in column 2 - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Query list with multiple columns to return a specific value where column 1 provides key to return value in column 2

Last post 06-30-2015 03:15 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-26-2015 05:12 PM

    Query list with multiple columns to return a specific value where column 1 provides key to return value in column 2

    So first of all, I apologize if this has already been answered. I simply don't know the proper lexicon to search for the correct terms but my issue is pretty simple I think. I have an InfoPath form that has two drop downs. Drop down 'A' is tied to SP list 'A'. This is displayed in field 'A'. Drop down 'B' is tied to SP list 'B', displayed in field 'B', and filtered by what is chosen in Drop down list 'A'. No problems with that. Now the issue. SP list 'B' has multiple columns. When the value in chosen in Drop down 'B' is displayed in field 'B', I need the corresponding value in another column from SP list 'B' that is in the same row as what is showing in field 'B'. For instance, if I have a list with columns 1, 2, rows 1,2, 3 when there is a match between a given value and row 1, column 1, I need to get the corresponding value in row 1, column 2. My filtering doesn't seem to be working correctly. Is the type of list data retrieval I'm asking about a lookup, or something else? I saw a mention somewhere else in this forum where this would be referred to a 'list query with a "where" clause. I.e. query a list where (string 'A' = array[i][j]), return array[I][j+1]. I hope I explained it okay. Can someone recommend a solution? Thanks. vr, frnorke EDIT: I figured it out using: receipe 43 from Infopath 2010 Cookbook 2. Instead of using the values of field 'A' and field 'B', the key to solving this is to use the native 'ID' column in SP list 'B' and filtering using that ('ID'). Contact me if you need further clarification.

    Filed under: , , ,
  • 06-30-2015 03:15 PM In reply to

    Re: Query list with multiple columns to return a specific value where column 1 provides key to return value in column 2

     Wow - great that you were able to find the answer. SharePoint does store the IDs for lookups in lists - even though often the lookup is set to display a different field. That can make figuring out your XPath filters a little tricky. :)

    Hilary Stoupa

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