Get display name for drop down list in another field - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Get display name for drop down list in another field

Last post 06-07-2019 11:36 AM by Hilary Stoupa. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 06-07-2019 08:28 AM

    Get display name for drop down list in another field

    I feel like I have looked everywhere for this answer, but cant seem to get it work how I like. Here is my situation. I have a sharepoint list that looks like this ID | Product | Price 1 | Item | 100 2 | Item2 | 300 Infopath has 2 fields (in this scenario): Product (Drop down list) Price (Read Only Text) I then have an infopath form reading from that table. What I would like to happen is, the user selects the product from a drop down list, and the unit price is shown in a read-only text field. Here is what I have tried, but ran into issues For the drop down, set the display to Product and the value to Price, then set the default value of the Price field to Product, which brings back the value (not display). This is exactly what I want, except when I publish this to a sharepoint site, and save it, the form will create a list entry with ID | Price | Price, and never set the display name.
  • 06-07-2019 08:30 AM In reply to

    Re: Get display name for drop down list in another field

    Sorry for the terrible formatting, not sure why new lines are not coming in
  • 06-07-2019 08:35 AM In reply to

    Re: Get display name for drop down list in another field

    Sorry about the formatting issues - the forum software is old - use IE for best experience (even though I don't, I just gave up on line breaks & use Chrome). I think you should set the dropdown to use the name for the display and value and add a rule to the product field that sets another field to the price. Let me know if you need a hand with that - you can attach a copy of your form under Options in a reply.
    Hilary Stoupa

  • 06-07-2019 09:00 AM In reply to

    Re: Get display name for drop down list in another field

    Wow, thank you for the quick response! I do need a bit of help if you don't mind. So you are saying set Value and Display to Product. But then how would I get the rule to look at the price associated to that product in the table? ( I am extremely new to this, so I am sorry if I require a bit more hand holding)
  • 06-07-2019 09:58 AM In reply to

    Re: Get display name for drop down list in another field

    We add a filter when we select the table row to get back just the selected one... Do you mind attaching your form? I can set this up for you so you can see it.
    Hilary Stoupa

  • 06-07-2019 10:05 AM In reply to

    Re: Get display name for drop down list in another field

    Here's a sample. Set Value Sample view has a dropdown with a rule on it you can take a look at. Save the form locally, right click and select Design to open in design mode, then you can preview.
    Hilary Stoupa

  • 06-07-2019 10:08 AM In reply to

    Re: Get display name for drop down list in another field

    Sure. In this form, the items I am looking at the Product drop down and Unit Price text field. Please feel free to create new fields, as this more than likely will not be the final form design
  • 06-07-2019 10:26 AM In reply to

    Re: Get display name for drop down list in another field

    I changed the default value for your existing Unit Price field. See if this works as anticipated. Save locally, right click, select design to open in design mode.
    Hilary Stoupa

  • 06-07-2019 10:33 AM In reply to

    Re: Get display name for drop down list in another field

    Unfortunately I can't open it. It seems like its looking for your path, since its trying to reach out to a server. (pic attached)
  • 06-07-2019 10:37 AM In reply to

    Re: Get display name for drop down list in another field

    Scratch that, google fixed that one. Should have searched before I asked here! I am opening it and seeing it is working out. Thank you for all your help so far
  • 06-07-2019 10:48 AM In reply to

    Re: Get display name for drop down list in another field

    Alright, so that gets the correct value, so thank you very much! This may have opened up another can of worms though. Now when I publish it to Sharepoint, and try to add a new item, it throws the error show in the pic below. I added number(your formula) to the properties of the unit price box, but that didn't help it. Any ideas there? After clicking Submit -> error Ok, Value becoming NAN. Value is just (Unit Price * #Items)
  • 06-07-2019 10:59 AM In reply to

    Re: Get display name for drop down list in another field

    I wonder if part of the problem is that the Unit Price field is a choice type. Maybe change that to number?
    Hilary Stoupa

  • 06-07-2019 11:04 AM In reply to

    Re: Get display name for drop down list in another field

    I think I may have see what was wrong. It was my fault. I had the default value for the value field being just #Items and Unit Price. So what I did it made it so whenever #Items is changed, it sets Value to your foruma * #items, and that seemed to work out great. Thank you so much for all your help! Is there a good resource that I can look at so I can figure out the formula you wrote?
  • 06-07-2019 11:36 AM In reply to

    Re: Get display name for drop down list in another field

    This link has a few screenshots that may be helpful: http://www.ntss.eu/infopath-2013-populating-a-data-field-based-on-another-field-i-e-external-connection-2/
    Hilary Stoupa

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