cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Livi_1
Frequent Visitor

How to update a lookup field in SharePoint List

Hi,

 

I have two SharePoint Lists that are connected to Power Apps. The lists operate in a 1 to many relationship, a record in list 1 can have many records in list 2.

 

Name of List 1: Location 

Contents of List 1: {ID, Name, Location Details}

 

Name of List 2: Location Features

Contents of List 2: {SiteName: Lookup from List 1, SiteName.ID: Lookup from List 2, Originator Name: Name, Notes: Specific comments}

 

I have designed a form in Power App that can create a new entry for List 2: Location Features. 

The application operates in an offline mode and I have collated an offline collection which will get uploaded to SharePoint via:

Collect(LocationFeatures, colLocationFeatures);

 

My Problem: 

 

The collect function works for all columns within List 2 (LocationFeatures) except for the two lookup columns. The values remain blank after executing the collect function.

 

My Question: 

 

Is it possible for this to work using a lookup function? Should I have used a different data type?

If this is the right way to go about referencing information across two SharePoint lists, can you point out where I went wrong?

 

How I created the offline collection (variables with prefix F are the names of my data card values within the form):

 

Collect(colLocationFeatures,

{

Site Name: {value: FSiteNameValue.Selected.SiteName, id: Value(FSiteNameIDValue.Text)},
OriginatorName: FNameValue.text,

Notes: FComments.text

});

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Livi_1 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Livi_1 ,

A Lookup column is a "complex" field type and is actually referenced with the ID of the item in the "other" list. 

I use the same Collect function you do for new records from a collection, but do not use Lookup columns at all for this and many other reasons as they add unnecessary complexity to both reading from and writing to as well as issues with Delegation, Sorting and Filtering.

There will be other opinions on this, but my view is that unless you want to edit in a SharePoint "Quick Edit" datasheet view (and need drop-down choices), there is absolutely no reason to use Lookup columns as the same lookup can be done in Power Apps referencing the two relevant lists.

So to answer your question, if you choose Single Line of Text (and do the Lookup in Power Apps), all should work well for you.

 

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.

 

Hi @Livi_1 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Thanks @WarrenBelz 

 

I took your approach and used a simple text field instead. 

 

Do you know a good way to deal with relational databases using Power Apps or maybe I'm venturing past what its made for now ?

Hi @Livi_1 ,'

Power Apps is not the real issue - it can use SQL as a data source if you want to pay for the Premium connector.

SharePoint does a pretty good job as long as you manage the structure to account for the limitations.

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