populating a list with outside data - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

populating a list with outside data

Last post 02-14-2020 12:39 PM by Hilary Stoupa. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 02-13-2020 12:40 PM

    populating a list with outside data

    My infopath list is where engineers enter specs and measurements they take at sites twice a year. In subsequent visits to a site the first 25 fields (the specs) are apt to be exactly the same. They've asked about getting those 25 fields populated from the record of the previous visit. If I can get a direction of attack without going down too much of a rabbit hole I might try it. So far I've tried creating a secondary data source to the SAME list, and getting values from a previous record, filtering by the site-date combination which is my title field. I've tried doing this to populate field-default value, control-default value and in 'set a field's value' in form load rules. I go to 'formula' - show fields' advanced view - choose the secondary source - choose the field and filter by title = "Site1 2020-02-07" for instance. So far I have not gotten ANY values to show up. That is a very strong deterrent to any further experimentation. Is creating a secondary data source to the same list impossible? Is it more apt to work if I create a second list, with sites and their specs, as the external data source? Is there a simpler path I should be trying? Thanks
  • 02-13-2020 02:54 PM In reply to

    Re: populating a list with outside data

    OK, I've got a drop-down list populating from a different list, and rules to set some other fields from that list. (I am so helpless until I write my problem out in your forum.) So I guess my engineers will have to set the specs for each site in the secondary list, if they want it to populate their main list. I wish I had a way to populate (update) the secondary list from entrees in the main list (for instance if one of the spec changes). Thanks
  • 02-13-2020 03:02 PM In reply to

    Re: populating a list with outside data

    These are different fields? You are using list forms? Just add a data connection to the same list, and set it to not query when the form opens. Sort the data by Modified desc. Then when the user enters a site, set the site query field to the requested site and execute the query. Use rules to set your current fields from the 2DS fields.
    Hilary Stoupa

  • 02-14-2020 06:40 AM In reply to

    Re: populating a list with outside data

    Thanks Hilary, I am a bit new to SharePoint, and so a little lost in the lingo here. Currently my main list (siteVisits) has its drop-down list for 'site', and some 'siteParamaters' fields populated from a secondary list (siteSpecs), via a secondary data connection. The siteParameter fields values are set by rules when the drop-down control changes. Would your solution give me a way to update the secondary list from changes in the parameters in the main list? gran
  • 02-14-2020 07:56 AM In reply to

    Re: populating a list with outside data

    No. You will not be able to update one list from another list form using out of the box InfoPath and SharePoint List functionality. I may have misunderstood your question. I thought you were asking if you could populate the form with the most recent saved values.
    Hilary Stoupa

  • 02-14-2020 08:58 AM In reply to

    Re: populating a list with outside data

    Yes, if I can populate from the same list, without using a second one, that will be best. In my trial I wasn't able to get any data with simple rules. I'll try using the query fields, which I'm just beginning to understand. Where would I set to sort by Modified desc, in the all items view?
  • 02-14-2020 09:59 AM In reply to

    Re: populating a list with outside data

    OK,I dragged the new connection (to the same [main] list) fields onto the form in a repeating table, with a query field and a query button and all works, sorted by Modified desc. However it produces duplicate rows for the same site (since multiple exist). How do I get just the MOST RECENT row, from Site-A?
  • 02-14-2020 11:21 AM In reply to

    Re: populating a list with outside data

    So - the most recent row is the first one. In InfoPath, if we select a field from a repeating data source, it is by default going to return the first value - that's why I had you sort desc. :-) You can also just index the XPath if need be - select the field using the field picker, in the formula editor tick the box to show the XPath and put [1] after the repeating node.
    Hilary Stoupa

  • 02-14-2020 11:23 AM In reply to

    Re: populating a list with outside data

    It looks like I can set a query field, query the DS2 and then set a different query field and query again - further refining the data. So after getting the Site-A records set DS2 query field "ID" to DS2 data field max(ID), getting the latest of the site-A entrees - does that sound right?
  • 02-14-2020 11:32 AM In reply to

    Re: populating a list with outside data

    Sure, you could. I wouldn't - but I'm guessing you were posting this as I was posting my reply.
    Hilary Stoupa

  • 02-14-2020 12:19 PM In reply to

    Re: populating a list with outside data

    Yes our posts did cross. I see that I am able to populate fields from the top repeating row without isolating the row. It looks like I'm on my way. I learned a lot today. Thanks, gran
  • 02-14-2020 12:39 PM In reply to

    Re: populating a list with outside data

    So there are a few behaviors in InfoPath that I don't find intuitive - but that we can sometimes leverage to our advantage. This is one - if you don't specify the row with an index or XPath filter, you get the first value. The second is that if you set a field inside a repeating node from outside (i.e., you have a button at the top of your form not in a repeating section bound to the node) you will set all instances of the node. Glad you are forging ahead!
    Hilary Stoupa

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