Problem populating Infopath Dropdown with lookup column (in Sharepoint) - InfoPath Dev
in

InfoPath Dev

Problem populating Infopath Dropdown with lookup column (in Sharepoint)

Last post 03-25-2011 09:19 AM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 03-16-2011 02:51 AM

    Problem populating Infopath Dropdown with lookup column (in Sharepoint)

    Hi Folks, I had drop down in Infopath which fetch values from Sharepoint List lookup column. Values are coming correctly, but prefix with some junk data. e.g. "20#;CorrectValue1". "20#;" are junk values While research, I got to know that Sharepoint List column is a lookup and it is referencing another Sharepoint List column. And junk value are row number in reference List. I mean - "20#;" is the 20th row for 'CorrectValue1' in reference List. I tried creating another column in Sharepoint list having Calculating column type, but Calculating column type will not work for lookup column. I am using Infopath 2007 with MOSS. Please advice. - Chintan
    Thanks,
    Chintan
  • 03-22-2011 09:42 AM In reply to

    Re: Problem populating Infopath Dropdown with lookup column (in Sharepoint)

    Hi:

    The lookup columns for the list must have a data source, right? And that would be another list? Can you create a data connection to the original list?

    Hilary Stoupa

  • 03-24-2011 01:24 PM In reply to

    Re: Problem populating Infopath Dropdown with lookup column (in Sharepoint)

    I understand what Hilary is saying if it's true that you have an "original" list to read from instead. 

    I don't know if this will work but can you add a function to parse the string value to strip out the prefix?  e.g. substring(@CorrectValue1, 4, 4)?? Not sure but you could play around with it.

     

  • 03-24-2011 02:09 PM In reply to

    Re: Problem populating Infopath Dropdown with lookup column (in Sharepoint)

    Hey, dms.WebDev - I was thinking about the same thing at first, too. But I think the issue with that is that it would have to be a rule on the field itself... and rules run when a field changes....and the field won't be changing, just having data loaded from the original query. Since the field will be in a repeating group (coming from a SharePoint List) there really isn't going to be a rule based way to clean it up, I think....

    Hilary Stoupa

  • 03-25-2011 08:08 AM In reply to

    Re: Problem populating Infopath Dropdown with lookup column (in Sharepoint)

    What if you gave the field a default value on load like a space or . (dot) or something that would change?  Kind of a lame approach but it might work.

  • 03-25-2011 09:19 AM In reply to

    Re: Problem populating Infopath Dropdown with lookup column (in Sharepoint)

    Well, again, I think the issue is with it being secondary data. At what point is a 2ds field considered to have changed? Not on query, right? Because that is when the data is loaded, so I'd think that would be considered its original state. And to run a rule off the field itself, the field has to change. Obviously, this would be easy in code -- run the query, loop through the returned values, update them all to a substring. No issues there.... But in rules, I think it becomes a lot more difficult, because you have no way to really "loop" through the returned nodes....

    Of course, I had to go test this....So, I created a form, added a data connection to a list, added a rule to one of the fields to show a message box. I added a button to query the list. Querying (initial fill of the data source) doesn't trigger my rules. Changing a field does. Requerying AFTER changing a field does NOT. 

    Again, pretty trivial in code, but I'm not seeing how to do it in rules. qRules has a SetValue command -- that might be able to handle this, if a field with a counter that could be used to trigger the logic was added to the form (since we have to run the SetValue command for each row returned from the secondary data source).

    Hilary Stoupa

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