Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Reading value from another Sharepoint list base on dropdown list value

(0) ShareShare
ReportReport
Posted on by

Hello, 

 

Not sure if this is question for PowerApp or SharePoint lists. 

 

I have an app, that uses a SharePoint list (Main List) with the following columns:

Ajwou_0-1669730012904.png

where Type of Task is 'Choice' column - populated in PowerApp as Dropdown. 

 

Then I have another SharePoint list with columns below with pre-defined values:

Ajwou_1-1669730146590.png

So each task type has given assignee ie.

Washing     Judy

Cleaning     Peter 

etc.

What I am trying to do in the App/Main List is when certain 'Type of Tasks' is selected

Ajwou_2-1669730616491.png

 

, the app would also record the Assignee from the other list based on the Task Type. 

 

I have tried playing with Lookup value in the lists and also lookup within PowerApps but cannot get it working. 

 

Please can anyone help. 

 

Kind Regards, 

 

Ivo

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    @Ajwou ,

    That sounds about right.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Ajwou Profile Picture
    Ajwou on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    @WarrenBelz 

    I changed the Assignee columns in both lists to TEXT. I suppose I will have to use a different code now?

    Would that be only a simple LookUp function now?

    LookUp('RFI_IRL-Services','Task Type'= DataCardValue21.Selected.Value,'Assignee Name')

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    @Ajwou ,

    Did you put the code I supplied in the DefaultSelectedItems of the Assignee Combo Box ? If it does not work, please consider going back to text fields for both areas and this will all go away.

  • Ajwou Profile Picture
    Ajwou on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    @WarrenBelz 

    Yes, writing back to Person Field. For some reason when I select the Task type, nothing appears in the Assignee ComboBox and when I submit the form, nothing comes through in the Assignee field (Person type)

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    @Ajwou ,

    If you are writing back to a Person field, the code I posted would be a good place to start.

  • Ajwou Profile Picture
    Ajwou on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    @WarrenBelz 

    Apologies for the mix-up of Dropdown and ComboBox. 

    The Update of the DataCard is DataCardValue1.Selected 

    Ajwou_0-1670317745788.png

     

     

     

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    Hi @Ajwou ,

    What do you mean by it doesn't generate any value - in the ComboBox or Parent List ?

    If it is not saving, what is the Update of the Data Card . You also described this control as a Drop-down - if it is a Combo Box, forget about the Default - you need this in the DefaultSelectedItems

    {
     DisplayName:
     With(
     {
     wName:
     LookUp(
     SecondListName,
     TaskType = TypeOfTaskDropdownName.Selected.Value
     ).'Assignee Name'
     },
     With(
     {
     wEmail:
     First(
     Office365Users.SearchUser(
     {
     searchTerm: wName,
     top: 999
     }
     )
     ).Mail
     },
     {
     Assignee:
     {
     Claims: "i:0#.f|membership|" & Lower(wEmail),
     Email: wEmail,
     DisplayName: wName,
     Picture: "",
     Department: "",
     JobTitle: ""
     }
     }
     )
     )
    }

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Ajwou Profile Picture
    Ajwou on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    @WarrenBelz 

    Yes, that fixed the issues with the code. I set is as 'Default' parameter for the Assignee ComboBox field, however when I fill in the TypeOfTask it doesn't generate any value - in the ComboBox or Parent List  . I have both lists connected to the app.

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    @Ajwou ,

    Please see correction - dangers of free-typing code (was missing field name)

  • Ajwou Profile Picture
    Ajwou on at
    Re: Reading value from another Sharepoint list base on dropdown list value

    Hi @WarrenBelz , 

     

    I wasn't sure about the right data structure here. The Assignee field doesn't even have to be shown in the app. The aim is to log the details provided from the app, and then based on the selected/recorded 'task' add an assignee from a predefined list. 

    I have tried the code above and getting the following:

    Ajwou_0-1670232184792.png

    Not sure what I am missing here. 

    I currently have thh main list Assignee as 'person' type and secondary list as 'text'

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard