cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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.

View solution in original post

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
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (8,828)