Autopopulate from Secondary source displays item ID# instead of Customer Phone - InfoPath Dev
in

InfoPath Dev

Autopopulate from Secondary source displays item ID# instead of Customer Phone

Last post 12-06-2013 08:00 AM by Hilary Stoupa. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 11-03-2011 09:02 AM

    Autopopulate from Secondary source displays item ID# instead of Customer Phone

    Hi all.  I have successfully done this at least 10 times over the past several weeks with other lists. In this case I have created a contact list which contains Customer Name, Phone, Address, etc.  Pretty basic stuff. I then created a second list for Projects in which I have Customer Name (dropdown) as a lookup from my contact list. Works fine. I then access InfoPath to customize my Project list form. I create the data connection to my Contacts list and select Customer Name, Phone and Address. I then add a text box and set the field properties to:  select Phone from contacts list then filter where Contacts Customer is equal to Main Customer.  This returns nothing.   So then as a test I simple made this newly added text box = to Main Customer.  To my surprise the record ID number is displayed, not the customer name selected. Like I said, I have done this before with the assistance of instructions from this forum that were very straight forward. I have checked all settings/values and even deleted the Projects list and started from scratch... still the same result. Has anyone ever seen this behavior before?

    Filed under:
  • 11-04-2011 12:54 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

    Hi:

    So your customer name drop down - are you using the ID for the value and the name for the display? It sounds like that may be the case here.

    Hilary Stoupa

  • 11-04-2011 01:28 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

    If I use Value=Company Name and Display Name=Company Name for my Company Dropdown it works properly and I am able to auto populate other cells on my form from the dropdown selection HOWEVER I am unable to save the form due to the error: InfoPath cannot submit the form because if contains errors. Errors are marked with either a red asterisk......  

    In researching the error I found that I should change the following and it is supposed to go away.  If I use Value=ID and Display Name=Company Name for my Company Dropdown the dropdown works properly but I am not able to auto populate the other cells.

    So in my limited InfoPath knowledge it would seem to be a filtering issue but I just can't figure it out.

  • 11-04-2011 02:01 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

    Well, it sounds as if your field with the dropdown bound to it may not be a string datatype. Can you paste the formula you are using to set the value of the Phone, for example? Click the box that says "edit Xpath" first, so I can see the full XPath? Or just attach your template to a reply, under the Options tab.

    Hilary Stoupa

  • 11-04-2011 02:10 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

    Hilary,

    Thank you SO much for your time. I have attached my Leads.xsn file.

  • 11-04-2011 02:20 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

    Okee dokee, now I'm kind of understanding what's going on - I hadn't realized this was a SharePoint List form.

    I made some guesses in the attached file - save it locally (right click and save as), then right click on the saved file and select Design to open in IP designer.

    I removed your rule on the Company field. I set the drop down on the Company field back to Value = ID from the Contacts list. I changed the filter on the telephone field - now it is Phone where ID = Company.

    Try this copy and see if we are getting anywhere. :-)

    Hilary Stoupa

  • 11-04-2011 02:28 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

    IT WORKED!!!  I guess I don't comprehend how ID can equal Company.   Thank you so much.

  • 11-04-2011 02:58 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

    Let me see if I can try to explain it, okay?

    Your Company field in your form is a lookup. It is using an ID (number value) for the value of the field (which is what is actually stored) and it displays the company name based on that ID.

    So let's say you have some rows in your contacts list (which is what provides values for your Company lookup) and they look like this:

    ID     Name
    1       Sam's Sub Shop
    2       Mary's Hair Hut

    Your form would be storing either 1 or 2, based on what was selected. But since it is a lookup and is looking things up based on the ID that is stored, it displays the name - Sam's Sub Shop or Mary's Hair Hut.

    Thus, in your filter, you want to select items (like Phone) based on the ID in the Contacts list being equal to the ID that is stored in the Company field.

    Did that help, or just make it more confusing?

    Hilary Stoupa

  • 11-07-2011 06:27 AM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

    By George I think I've got it!  Now if I could get that annoying "Only positive intergers allowed"  message to go away for the Company field.  Hilary, can you recommend a book or online training for InfoPath?  I have been impressed with the application and it is fairly straight forward to use however my list of projects is getting larger now that staff can see what SharePoint is capable of, and the projects are getting more advanced. I am used to having a team of developers to work with but here it's just me. I am working on an ODBC connection to our AS400, a CRM solution, and various others.

    Many thanks!

    Corrie

  • 11-07-2011 06:09 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

    Well, the reason your field requires an integer (I'm guessing here) is probably because it is a lookup, thus it needs to store the ID (which is an integer) of the item you are looking up. I checked one of my SharePoint List forms - and the datatype shows as a Lookup on the field - which isn't super helpful ... and I get the same error if I change my dropdown to anything but the ID for the value.

    As to training - Qdabra, the company I work for, offers classes, including online options.. Otherwise I'd recommend you look for a book specifically for InfoPath 2010, as it seems you are taking advantage of those features. Searching on Amazon brings up a couple that seem to be specifically for working with InfoPath 2010 with SharePoint 2010. If you run across a book you think is great - please post that info here, so others can find it.

    Hilary Stoupa

  • 12-05-2013 04:13 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

     Hello Hilary (again)

     

    I came across this thread and I think I am having the exact same problem. I have tried following and reproducing the solution but I think I am just missing something.

     

    I am focused on the 2 fields called

    OSE_Function
    STAMPTask

     

    They get their info from the OSE_Task and SP_Functional_Tasks

    I also have a backend SharePoint list I am pulling from and I only get the corresponding number value and not the TEXT value.

     I was wondering if you could take a look at my form also.

     

    Thanks!

    Joe Dostie
  • 12-05-2013 06:16 PM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

     Can you add a screenshot showing your form in preview with the problem circled for me? Thanks - then I can look at your form and get an idea of what the issue might be.

    Hilary Stoupa

  • 12-06-2013 07:33 AM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

     Sure can...

     

    I have 2 SharePoint lists on the backend

    This one feeds a LOOKUP field in my other SharePoint list, my results end up being what's on this page.

    SP_RPM_Activity

     

    This SharePoint list is what I use to feed the InfoPath form,

    When I select "Patching OS" I want to get "Maintenance" not the ID 1 from the above screen shot.

    SHarePoint List

     

    Note that the result is "1" and not "Maintenance"

    Result

    Joe Dostie
  • 12-06-2013 08:00 AM In reply to

    Re: Autopopulate from Secondary source displays item ID# instead of Customer Phone

     Perfect - and you are half-way there, since in Function your default value returns the ID for the item you need. You should be able to add a data connection to your SP_RPM_Base list next (if you don't already have one) and use that current default value either as a value for a query field in that list (i.e. - you'd set the ID query field to this value, query, and then set your Function field to the returned title, since that query should return item 1 from SP_RPM_Base) or if your list is small (as this on is) you could have all items returned when the form loads and then use what you currently have to filter that list to get back "Maintenance".

    Hilary Stoupa

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