Query by ID and Date - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Query by ID and Date

Last post 06-29-2021 07:43 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-28-2021 12:47 AM

    Query by ID and Date

    Hello everyone! Thanks for having me. I do have my form connected to a Sharepoint table (my data source). From that table I'd need the form to pull the latest entries of a user. I am stuck at this very point. Either I pull by ID or by date: - if by ID, then I have no clue how to have the form query for the latest date. - if by date, then latest dates getting queried, but not by the ID (mixing up the users). Please see the attached example screenshot (sry for quality). Thanks for the insights. Best, Csaba
  • 06-28-2021 08:16 AM In reply to

    I would probably query by user, sorted by date desc, and then you know the first returned row is the row you want.
    Hilary Stoupa

  • 06-29-2021 04:45 AM In reply to

    Thanks for your response Hilary. That is exactly the piece I am not sure how to address. If I do set "Data Connections/Data connections for the form template: >>Chosen Sharepoint (data source) list >> Modify >> chosen location >> to "sort by:" and "sort order (ascending)" and pinpoint to the column that contains the dates, it does not pull the right unique identifyer, but simply the latest date from all the dates available in the column. By the same method, if its set to be sorted by the unique ID, it selects the right under user, but with the first available date there is, not the latest one I'd need. Hope this makes sense.
  • 06-29-2021 06:44 AM In reply to

    the screenshot attached indicates what I was trying to refer to.
  • 06-29-2021 07:43 AM In reply to

    When you set up the data connection, on the last screen, there is a checkbox for returning data on form load. Deselect that. But keep your sorting as you currently have it. Then, in form load rules (or whenever you know the ID - maybe there is something the users do or select that indicates that), you can set the ID query field in the list connection, and run the query. At that point, you'll have only rows for that ID. Does that make sense? I'm not sure when / how you know the ID in your form - but hopefully using query fields will help. :)
    Hilary Stoupa

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