cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
diegoadum
Advocate V
Advocate V

Looking for a record using unique id, simple right? well, think again!

Hi folks, I'm having a hard time trying to figure out how to solve the situation I have now. I'm using 3 Drop-down list control to allow my users to select a category which is nested in 3 levels, and as a result I'm storing just a single ID which is unique for each combination in my tickets list. Just for reference, the categories exist in a SharePoint custom list and the tickets in another SharePoint list. 

 

Everything goes well until we start noticing that when a user open an existing record, the information in the categories does not corresponding to the ID in that record. So, I know that working with Drop-down list control you have to focus in 2 parameters. Items and Default. Default as input data and Item as output data. Since the output is working well, I focus in the default using the below formula.

 

In the Default parameter I have:

 

LookUp(RazonesYContactos; ID=Value(SharePointIntegration.Selected.Tipo_x0020_de_x0020_Solicitud);Title)

Also I tried:

LookUp(RazonesYContactos; ID=Value(SharePointIntegration.Selected.Tipo_x0020_de_x0020_Solicitud)).Title

 

for your reference the Title field in SharePoint is renamed to "Razon 2"

 

The issue here it seems that the Lookup funcion don't care about the fact that the ID is unique and get other records. So considering the below table:

 

 

Captura.JPG

Regardless the ID=97, 138 or 139 and I end up getting always the first Razon 2 record.

 

There is no connection between this 2 tables as well as there is no relationship created. There are 2 independant tables.

 

BTW, I know that Lookup gets the first record that satisfies a formula, but again, the ID is unique so my poor head understand that there are not multiple record with the same ID to choose from, right?

 

Thank in advance for any guidance on this!!!

 

1 ACCEPTED SOLUTION

Accepted Solutions

The way I've fixed this is isolating each dropdown list. Also, I have to add the 3 fields in my custom list. So...at the end I use a very inefficient way. 

View solution in original post

6 REPLIES 6
cwebb365
Super User
Super User

How many records are in the SharePoint integration you are trying to have equal to ID? One thing that drives me batty about powerapps and SharePoint as the source is that the IF field isn’t delegable so you’ll run into delegation issues when doing lookups marching on ID. Just a hunch here.

But also the field your doing the ID = to did you say it’s a drop down? Trying tapping in the .value at the end of it.

Thank for your reply. The Category list table is less than 100 records.

 

Just to clarify. the lookup is comparing the ID of the category table against the ID value stored in the field of the ticket table.

 

Imagen 1.png

cwebb365
Super User
Super User

So on a new ticket it works this is existing? What control is triggering this? Assuming you have a select list and your clicking and going to another screen and wanting to populate everything?

If that’s the case you’ll probabaly be better off having a variable set with the “selectedid” and passing that variable into the controls so when you select from a main screen to edit it can come through.

You right, I did that. I've set up a variable storing the value of Value(SharePointIntegration.Selected.Tipo_x0020_de_x0020_Solicitud)).Title but the result is exactly the same.

diegoadum
Advocate V
Advocate V

I realized that the issue is not with the lookup command but with the way that the dropdown list works. When the Default parameter is getting the data to show the current information in a field (for example), it seems the Item parameter is overwriting the values. Tests I did kind of proof that. 

The way I've fixed this is isolating each dropdown list. Also, I have to add the 3 fields in my custom list. So...at the end I use a very inefficient way. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,521)