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 / Lookup Not fetching va...
Power Apps
Answered

Lookup Not fetching value from List

(0) ShareShare
ReportReport
Posted on by 599

Hi,

In my scenario i have a List. In my list i have a two columns called Department and People. Like Following,

DepartmentPeople
Development4

A People column is a Number field in a list and Department is a Single line of text.

 

Am using following formula,

LookUp (List, Department=Label1.Text,People).

 

The above formula not showing a Correct a Value in Button's OnSelect.

But when am checking on a Label's Text it's showing Correct value 4.

 

Why? It is Anything wrong in my formula?

 

Thanks,

Dhinesh

 

Categories:
  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @Dhinesh28R 

     

    Your formula looks correct. But based on my understanding of your problem, if you are using that formula in a button's OnSelect property it will not work because it requires an action and your lookup formula returns a text. So an example would be to write this action on the button OnSelect.

     

    Notify(LookUp (List, Department=Label1.Text,People))

     

  • Dhinesh28R Profile Picture
    599 on at

    Hi @Adrian_Celis,

    It's working in notify.. But not working in a Patch function.

    I need to update a Value on button click.

    Here is what i did,

    Set(PID,LookUp(List,Department=Label1.Text,People));
    Patch(ListLookUp(List,Department=Label1.Text,People),{People:PID+1});

     

    But its not updateing into a List.

     

    Thanks.

     

  • Verified answer
    Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @Dhinesh28R 

    The second argument in your formula should be a record so you need to change the lookup function.

    Change your formula into this and see if it works:

     

    Set(PID,LookUp(List,Department=Label1.Text,People));
    Patch(List, LookUp(List,Department=Label1.Text),{People:PID+1});

     

  • Dhinesh28R Profile Picture
    599 on at

    Hi @Adrian_Celis ,

    Am using this type only. But it is not updating man.

     

    Thanks

  • Verified answer
    Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @Dhinesh28R 

     

    I have recreated your scenario based on the info that you have provided and seems to be working on my side. So now what you need is to isolate the problem.

     

    Try this formula on your button OnSelect, It should show the number 4.

     

     

    Set(PID,LookUp(List,Department="Development",People));
    Notify(Text(PID));

     

     

    If that that does not show a number, then something is wrong with Label1

    If it shows the number, then try to patch it using this code

     

     

    Set(PID,LookUp(List,Department="Development",People));
    Set(PatchID,
    Patch(List,LookUp(List,Department="Development"),{People:PID+1})
    .ID)
    ;
    Notify(Text(PatchID))

     

     

    What this does is that it will show a number if it successfully patches.

    If nothing shows then something is wrong with the patch.

    Let me know the results.

  • Dhinesh28R Profile Picture
    599 on at

    Hi @Adrian_Celis,

    Its not updating a value in a List.

    Its showing in Notify an error occured.

     

    Thanks.

  • Dhinesh28R Profile Picture
    599 on at

    Hi @Adrian_Celis ,

    Sorry man. I think its my fault.

    As well as am decrement in a same list.

    DepartmentPeopleOut
    Development41


    Patch(List,LookUp(List,Department= Label1.text),{People:PID+1,Out:OID-1})

     

    Now its wokring fine man. Before what i did means i did separate Patch function for Increment and Decrement.

    After that now am doing in a same Patch function like above i mentioned formula.

    Now its working properly man.

     

    But i need to know why its not properly working in Separate Patch function?

     

    Thanks.

  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @Dhinesh28R 

    Please share with me your formula for the separate patch function that you did so I can assist. Thanks

     

    Regards,

    Adrian

  • Dhinesh28R Profile Picture
    599 on at

    Hi @Adrian_Celis,
    This is what i did with separate Patch function man.


    Patch(List ,LookUp (List ,Department=Label1.text),{Out:OID-1});


    Patch(List ,LookUp (List ,Department=Label1.text),{People:PID+1});

     

    Thanks.

  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    @Dhinesh28R 

     

    I tested your formula on the separate patch function and seems to be working fine.

    How are you setting the variable named "OID"?

    Any errors showing? Or is it simply not patching?

    Which one is patching successfully and which one is not?

    Any reason why you are creating two separate patch functions instead of just one?

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 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard