cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dhinesh28R
Post Partisan
Post Partisan

Lookup Not fetching value from List

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

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

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});

 

View solution in original post

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.

View solution in original post

11 REPLIES 11
Adrian_Celis
Responsive Resident
Responsive Resident

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))

 

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.

 

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});

 

View solution in original post

Hi @Adrian_Celis ,

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

 

Thanks

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.

View solution in original post

Hi @Adrian_Celis,

Its not updating a value in a List.

Its showing in Notify an error occured.

 

Thanks.

Dhinesh28R
Post Partisan
Post Partisan

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.

Hi @Dhinesh28R 

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

 

Regards,

Adrian

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.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,282)