cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tsparkman
Helper II
Helper II

LookUp field not saving to SharePoint

I'm hoping someone can help me!

 

I have an a app that is tied to two SharePoint Lists

 

Projects List:

  • ProjectName
  • ProjectDescription
  • ProjectCost
  • PartOfApprovedCamp (Yes/No)
  • CampaignName (this is a lookup field to my ApprovedCampaigns list

image.png

 

ApprovedCampaigns List:

  • Title (this is the campaign name)
  • ApprovedBudget
  • CMOApproval (choice field with options for Pending, Approved or Rejected)

 

In my app, I have a New Project Form. On the form there is a field for “Is this part of an approved campaign?" If the user selects “Yes”, I display the CampaignName field and filter the items to only show campaigns that are flagged as approved. This is what I have in the Items property of the DataCardValue:

 

SortByColumns(Filter('Approved Campaigns',CMOApproval.Value="Approved"),"Title")

 

 

The options in the drop-down work as they should. 

 

The OnSelect property of the Save button is simply: SubmitForm(frm_NewRequest)

 

Problem:

All of the form data saves except the CampaignName field. It does not throw any errors, but just simply does not save the selected CampaignName to the Projects list.

 

I have tried everything I can think of, but with no success. Any help or insight is greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @tsparkman ,

Update of the data card would be something like this (I am also wondering why you are using a Lookup field when you are doing it in Power Apps)

{
   Value:ComboBoxName.Selected.Title,
   Id:
   LookUp(
      'Approved Campaigns',
      Title = ComboBoxName.Selected.Title
   ).ID
}

 

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

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @tsparkman ,

Update of the data card would be something like this (I am also wondering why you are using a Lookup field when you are doing it in Power Apps)

{
   Value:ComboBoxName.Selected.Title,
   Id:
   LookUp(
      'Approved Campaigns',
      Title = ComboBoxName.Selected.Title
   ).ID
}

 

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 @WarrenBelz - Thank you so much for your response. I just tried that and it worked!

 

However, now I'm curious as to why you suggest that I don't need to use a Lookup field 😄 Can you elaborate? Is there a better way to accomplish what I'm trying to do? Any guidance is greatly appreciated!

Hi @tsparkman ,

I have not used Lookup columns for many years and they are completely unnecessary unless you want to interact with SharePoint directly in an datasheet view (and you can do an editable gallery in an integrated app to do the same thing). You only really need to store the data - everything else can be done in Power Apps - I have a blog on data structure that may assist.

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 (3,046)