web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error referencing Depe...
Power Apps
Answered

Error referencing Dependant Value in form

(0) ShareShare
ReportReport
Posted on by 31

I have an excel data source with 2 columns - Item Code and Item Name. 

 

In Power Apps I have Screen1 with a Combo Box where users choose Item Code and a List Box with Value = Item Name and A Dependency of  - [Parent Control = Item Code, Result and Matching Field = Table1, Item Code].

 

This returns the Item Name automatically in the List Box when the Item Code is selected in the Combo Box.

 

Then Screen2 has a form with a data source of a Sharepoint List.  The Item Code is pulled through via "ItemCode.Selected.Result" but I can not get the Item Name to pull through.....tried all sorts of combinations.

 

Could someone assist if possible please?

 

Thanks, Adam

 

Categories:
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @aaacollett ,

     

    If I get it right:

     

    1. You have a ComboBox populated with all your "Item Codes"
    2. You have a ListBox populated with all "Item Names" related to the selected "Item Code"
    3. And you want to get the selected "Item Names" from your ListBox

     

    Do you want to extract one or many "Item Names"? How do you want to store them in your SharePoint list?

     

    If you want to get them from the selected items of the ListBox, you should be able to use "SelectedItems".

     

    If you want to store them as a text, you could use "Concat()" to create a text from a list of values.

     

    Concat(
     ItemNames.SelectedItems,
     Value,
     ";"
    )
  • aaacollett Profile Picture
    31 on at

    Hi

     

    Thanks for replying.  The Item Code (SKUCode) only ever has one Item Name (Product Name).  I have tried entering  ProductName.SelectedItems in the form but it errors (see images)

     

    Thanks, Adam

    Screenshot 2022-11-17 084740.png
    Screenshot 2022-11-17 084850.png
    Screenshot 2022-11-17 084812.png
  • WiZey Profile Picture
    3,023 Moderator on at

    "SelectedItems" returns a table, but I'm guessing your "ProductName" datacard is expecting a text.

     

    If you only have one "Item Name" per "Item Code", then why using a ListBox? ListBox is made to select one or many items, however, if you're always having a single value, you could use a Label instead.

     

    Can you replace the ListBox with a Label then fill in the datacard with "Label.Text"?

  • aaacollett Profile Picture
    31 on at

    Hi...lost me slightly...how do I get a Text box to pull through the Item Name based on the Item Code? (the list box does it via a Depends on query)? Thanks

    Screenshot 2022-11-17 113825.png
  • Verified answer
    WiZey Profile Picture
    3,023 Moderator on at

    With a "LookUp()".

     

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-filter-lookup

     

    "LookUp()" returns the first record from the source matching the conditions you set.

     

    LookUp(
     Source,
     ItemCode='code'
    ).ItemName

     

    However, that would require to modify the forms and much more, so forget that idea and let's just focus on the ListBox for now.

     

    As I said earlier, "SelectedItems" return a table, and I'm guessing your "ItemName" is expecting a text. Because you're really only getting a single value in your ListBox, you could use "First()" to get the first (and only) record in your ListBox, granted it's been selected.

     

    First(LisbBox.SelectedItems).somethingsomething

     

  • aaacollett Profile Picture
    31 on at

    Hi @WiZey 

    Sorry for delay in replying, have sorted it but possibly not as nature intended....

    1. Created a Dropdown box [dropdown1] (not Combo as originally had) with the same Depends on criteria Filter (Table_query, SKU = SKUCode.Selected.Result) - however this does not support word wrap and therefore couldn't easily see long Product Names

    2. Set dropdown1 to visible = false to hide it

    3. Added a List Box with Items = dropdown1.selectedtext to show the Product Name with word wrap

    4. Within the form on Screen 2 put the default for ProductName as Dropdown1.SelectedText.'Product Name'

     

    Bargain! Works a treat. Thank you for you help as wouldn't have got there otherwise 😁👊

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard