cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shaunus
New Member

Collect function in PowerApps not populating data in lookup field in SharePoint list

Hi potential question answerer,

 

I'm building a Power App that has a gallery of "Issues". When you select an item my "frmIssues" goes into update mode via "varCurrentIssue" variable. I want to attach some referential data to this Issue item but I'm getting some strange behaviour..

 

I have a "BugCreator" SharePoint list I want to link to the "Issues" SharePoint list:

columns.PNG

 

I have a button that that creates some data in the BugCreator list that should tie back to the Issue:

 

Collect(BugCreator, {Title:"Bug: " & varCurrentIssue.Title, StoryPoints:5, IssueTrackerItem:varCurrentIssue});
Set(varStatus, "Bug Created");
SubmitForm(frmIssue);
ResetForm(frmIssue);

 

 

The problem is the Title is there and looks good:
Title: "Bug: A New problem",

StoryPoints: 5,

IssueTrackerItem: !Required Info

 

Why is there no data in only the lookup column?

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Shaunus 

The LookUp column requires a special structure.  I am assuming varCurrent issue doesn’t contain something that looks like this:

 

{
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id: 1,
    Value: "Text Description"
}

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@Shaunus 

The LookUp column requires a special structure.  I am assuming varCurrent issue doesn’t contain something that looks like this:

 

{
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id: 1,
    Value: "Text Description"
}

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@mdevaney  Thanks for the quick reply 😁

 

You've solved it in one! 

I couldn't work out why it would accept the type but wouldn't link it SP side.. I did see that syntax but couldn't for the life of me figure out how to get it to compile until you laid it out for a 5 year old.

 

I normally work with C# - feel like a right idiot now 😅

 

Thanks again, much appreciated!

@Shaunus 

Anytime man!  Best of luck building your app.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (6,449)