cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RodM
Helper III
Helper III

Lookup column items cached after addition/removal? (Refresh function not a fix)

I am working with 2 SharePoint lists within my app (Ex: MainList, LookupList). One of them has a lookup column that relates to the other list.

 

I also have a form within my app which allows items to be added to the LookupList. However, sometimes after adding items or deleting items, they do not show up, or continue to show even after being deleted. Hard clearing of the browser cache (Ctrl+F5) is the only immediate fix (or whenever the browser cache clears itself via closing/reopening).

 

I tried Refresh functions in several places, and am not able to get any consistent results. Has anyone run into this before? For additional info, the lookup list has just 265 items.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @RodM ,

Depending on whether you wanted Distinct values - I will use that here - just be aware of Delegation limitations

Sort(
   Distinct(
      SecondList.LookedUpField
   ).Result,
   Result
)

It is also an option to design your data to not need lookup columns, with reference lists if necessary due to Delegation.

 

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

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

HI @RodM ,

Lookup columns are not the best friend of Power Apps at times (I have not used them for many years) and this is another example of their limitations. SharePoint is not a relational database and will not resolve this query automatically without being re-queried. Look up the second list directly and the issue will resolve.

 

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

@WarrenBelz , Thanks for the reply. Can you please provide some specific steps on how to achieve this within a form?

How can I lookup the second list directly within a form tied to the "MainList'? Assuming the form starts with a default code of:

Choices([@'MainList'].'LookupColumn')


What would I change this to to allow direct lookup, and selection of items on a form to be submitted to the 'MainList'? When I tried the following code (along with updating the Fields option) it populates the dropdown with the items needed, but after submitting the form, the data in the 'LookupColumn' field ends up being blank.

 

Sort('LookupList',Items)

  

I ended up changing the lookup column in the MainList to a text column, and then added a dropdown control to feed it the Selected Items. But if you can still provide possibly another alternative, it would still be appreciated.

Hi @RodM ,

Depending on whether you wanted Distinct values - I will use that here - just be aware of Delegation limitations

Sort(
   Distinct(
      SecondList.LookedUpField
   ).Result,
   Result
)

It is also an option to design your data to not need lookup columns, with reference lists if necessary due to Delegation.

 

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

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.

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 (5,708)