Trouble Shooting: Mystery Records - InfoPath Dev
in

InfoPath Dev

Trouble Shooting: Mystery Records

Last post 05-11-2009 03:20 PM by richardlpalmer. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 05-11-2009 12:04 AM

    Trouble Shooting: Mystery Records

    I wish I had a better way to describe what I'm encountering but here's the details of what I have.

    One section of my form has a text box with a formula displaying contents (if any) of 21 columns. This is detailed in a different thread, over here. It was working well until I added another control to a different part of the form -- completely disrelated. I added a section that holds various check boxes and one check box that makes that section hidden/appear.

    What I'm finding now is that when I open a form it displays content that isn't in my SharePoint list. Maybe a picture would help make this easier to grasp.

    Here's my list item. As you can see, there is no record in RelDateA, RelDateB or RelDateC. There is a value in RelDateE & RelDateF.

     

    When I open my form it is displaying the values of RelDateA, RelDateB, RelDateC (although none exist per the above image), RelDateE & RelDateF

     

    I've checked and re-checked but can't figure out how the above is happening.

  • 05-11-2009 01:01 AM In reply to

    Re: Trouble Shooting: Mystery Records

    Okay, to further illustrate the problem, I edited the list item via the form. The list item now shows the first 5 items with entries.

     

    The form shows these 5 records. 

     

    Now, when I edit the list item it shows all of these fields blank and only the 7th one with a record (RelDateG). Great!

     

    However, when I open the form here's what I see.

     

    So basically, it's keeping these first 3 items in place, regardless. The items don't exist in the list but they're appearing in the form. I thought maybe I was pulling those items from the list of dates they're derived from but that's not the case. The secondary data source is the correct one...

     

  • 05-11-2009 01:19 AM In reply to

    Re: Trouble Shooting: Mystery Records

    Okay, I think I see the problem. The form is working the way I told it to, I just didn't tell it exactly what I wanted. :)

    What I see is it's looking at the entire RelDateA, RelDateB, etc. column and pulling any value it sees. So there are a ton of list items below the one I'm talking about above. Some of them have RelDateA, RelDateB and/or RelDateC selected. What I need to tell the form to do is just show records for THIS one item.

     (At least that's what I THINK is happening...)

    I expanded my screen shot to show 4 list items. RelDateA, RelDateB and RelDateC are populated within some of these list items -- my test item (first list item) only has RelDateJ. But as it's displaying RelDateA, RelDateB, RelDateC and RelDateJ above I'm making the assumption this is what's happening.

     

    I guess the question now is how do I get it to just display the one item's worth of data?

  • 05-11-2009 01:19 PM In reply to

    Re: Trouble Shooting: Mystery Records

    Well, got it sorted out. It probably wasn't the most expedient way to go about things but it's definitely efficient. I did a filter on each colum, matching the IDs so only one result was returned.

    The thing I'd like to get feedback on with this is my methodology. I had to do this filter 21 seperate times. I'm wondering now if I could have done it by making a section for the control to live in and then applied the filter to the control? What do you think?

  • 05-11-2009 01:52 PM In reply to

    I think (but I may have misinterpreted what you are doing) that since there isn't a built in way in InfoPath to filter your SharePoint data, you may have been stuck with your '21-filter' solution.... If you were displaying a control bound to the secondary data source on the form, then you would have been able to (for example) add a repeating table or section bound to the repeating group in your secondary data source and filter *that* to only disply if Id = Id (whatever the condition is).....Or, are you just needing to display this data? You aren't using the concat formula in a rule or something to copy it into your main data source?

    If you just need to display it, you could have used an expression box in a filtered repeating section... I've attached a sample. Right click on the link in the message header, select 'Save as', and save locally. Open in design mode and preview.

    Hilary Stoupa

  • 05-11-2009 02:30 PM In reply to

    Re: Trouble Shooting: Mystery Records

    I have a feeling you're on the right track but not sure.

    I was modifying an existing form. There is a Repeating Section that is filtered (basically like your sample). I needed to add some data, a list of 21 newly added columns to the SharePoint list this data was coming from. I ended up using a Text Box with the concat function, a bit of XML for line break between each item and then a filter for each. Here's what it looks like formula-wise:

    concat(substring-before(@RelDateA[@ID = QueryOID], " "), newLine, substring-before(@RelDateB[@ID = QueryOID], " "), newLine, substring-before(@RelDateC[@ID = QueryOID], " "), newLine, substring-before(@RelDateD[@ID = QueryOID], " "), newLine, substring-before(@RelDateE[@ID = QueryOID], " "), newLine, substring-before(@RelDateF[@ID = QueryOID], " "), newLine, substring-before(@RelDateG[@ID = QueryOID], " "), newLine, substring-before(@RelDateH[@ID = QueryOID], " "), newLine, substring-before(@RelDateI[@ID = QueryOID], " "), newLine, substring-before(@RelDateJ[@ID = QueryOID], " "), newLine, substring-before(@RelDateK[@ID = QueryOID], " "), newLine, substring-before(@RelDateL[@ID = QueryOID], " "), newLine, substring-before(@RelDateM[@ID = QueryOID], " "), newLine, substring-before(@RelDateN[@ID = QueryOID], " "), newLine, substring-before(@RelDateO[@ID = QueryOID], " "), newLine, substring-before(@RelDateP[@ID = QueryOID], " "), newLine, substring-before(@RelDateQ[@ID = QueryOID], " "), newLine, substring-before(@RelDateR[@ID = QueryOID], " "), newLine, substring-before(@RelDateS[@ID = QueryOID], " "), newLine, substring-before(@RelDateT[@ID = QueryOID], " "), newLine, substring-before(@RelDateU[@ID = QueryOID], " "))

    I just now tried simply dragging/dropping each of these items from the Secondary Data Source in to the Repeating Section and it's displaying just fine, with no need for additional filtering. I don't know why I didn't think of this before, it seems too obvious...

     But now that I think of it, I don't know how to apply the substring-before funtion to a Secondary Data Source, so it doesn't look quite like I need it to. Hmmm...

    It's things like this that make me discouraged.

  • 05-11-2009 03:00 PM In reply to

    Re: Trouble Shooting: Mystery Records

    If you use an expression box, you can use a formula (including functions like 'substring-before').

    Hilary Stoupa

  • 05-11-2009 03:20 PM In reply to

    Re: Trouble Shooting: Mystery Records

    Hadn't thought of that. In the past I've created Expression Boxes and once created haven't been able to change them to any other control. Never tried doing the reverse of starting with a Text Box and changing it to an Expression Box.

    This worked like a charm. And while it was a nuisance to have to do the conversion 21 times and then modify the Expression Boxes 21 times with the 'stubstring-before' function (wish I could apply it to the table/section the controls are in) it still worked fine and was plenty simple.

    Thank you all for the assistance. :)

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