Search code examples
sharepointsharepoint-onlinepowerapps

Referencing values from on sharepoint list into the edit form of another sharepoint list


I have a sharepoint list that contains the following information [list1]:

  • Resource Name [People or Group]
  • Project [Choice]

I have another list that contains the following info [List2]:

  • Resource Name
  • Project
  • Date of leave

I am writing a powerapps for the user to apply for a leave and data must be updated in list2, In the powerapps form, the Resource Name should be a dropdown of only the 'Resources' present in list1 [Display Name]. The 'Project' field must populate the project of the 'Resource' selected from list1.

I have set the following properties of DataCardValue of 'Resource Name' in the form to:

Items= Choices(list1.'Resource Name') 
Value= DisplayName

I have also set the following properties of the 'Resource Name' card in the form to:

Update=DataCardValue.Selected.DisplayName

No errors are indicated in powerapps, however when i am previewing the app, nothing is being listed in the dropdown of 'Resource Name'. Can you please help?

enter image description here


Solution

  • Change items property of dropdown control to:

    Distinct(list1, 'Resource Name'.DisplayName).Result
    

    Then change Value to:

    Result
    

    It should show you the options in dropdown control.