web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add new item to sharep...
Power Apps
Answered

Add new item to sharepoint list with refence fields.

(0) ShareShare
ReportReport
Posted on by 9

Hello all,

 

i can't find the way how to collect() an ne item to a sharepoint list with a refenced collumn to another sharpoint list.

let me explain what i need:

We have a list for planing internal educations in our company. So the fist List called (Schulungsübersicht) has all the informations except the employees who can book the education by itselve. The second List called "Teilnehmer" has a reference field to the "Schulungsübersicht" Title, wich is the Name of the Education.

 

i've created a Powerapp to search and select an education. on the Detailscreen there are all the informations. so there should be one button "book education" to add an item to the "Teilnehmer" List with the Title Information from the selected education an add the name of the current User to the List.

So my code looks like this but it doesn't work:

Collect(
 Teilnehmer;
 {
 Schulung: {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
 ID: LookUp(
 Schulungsübersicht;
 Titel = DataCardValue12.Text;
 ID
 );
 Value: DataCardValue12.Text
 }
 };
 {
 Teilnehmer: {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
 Claims: "i:0#.f|membership|" & Lower(User().Email);
 Department: "";
 DisplayName: User().FullName;
 Email: User().Email;
 JobTitle: ".";
 Picture: "."
 }
 }
)

the reference Field in "Teilnehmer" is Schulung and it references to the Titel field in "Schulungsübersicht".

 

any idea?

 

kind regards Alex

Categories:
I have the same question (0)
  • RabbyC Profile Picture
    10 on at

    Hi,

    I think I understand your question, it sounds like you are trying to populate referenced information using collected data, if that is the case, I will try and answer below. If not, ignore me!

     

    From my experience, using collect with lookup columns is not currently working 100%. I have tried to do something simillar in the past, but for some reason, the returned values dont match up with the values being given by the lookup. Have to tried doing your lookup directly to the data source, if possible?

    The last time, I was doing it so that I could allow the user to work offline, but had to abandon my efforts and make it online only, and then we worked around it from there.

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @zlex ,

    Do you want to update lookup field?

    ID is a read-only field, so you can't update it.

    Try this formula:

    Collect(
     Teilnehmer;
     {
     Schulung: 
     LookUp(
     Choices(Teilnehmer.Schulung);
     Value = DataCardValue12.Text
     )
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser";
     Claims: "i:0#.f|membership|" & Lower(User().Email);
     Department: "";
     DisplayName: User().FullName;
     Email: User().Email;
     JobTitle: ".";
     Picture: "."
     }
    )

    Here's a doc about how to update lookup column for your reference:

    https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

     

  • zlex Profile Picture
    9 on at

    Hello RabbyC,

     

    thanks for your answer. i've testet the code from @v-yutliu-msft and this do the trick.

     

    kind regards

  • zlex Profile Picture
    9 on at

    Hello @v-yutliu-msft,

     

     

    very thanks for your reply. Thats the solution and works fine.

    to update the lookup field was one of the problem.

     

    It saves me a lot of Time

     

    Kind Regards

    Alex

  • RabbyC Profile Picture
    10 on at

    No Worries, glad you sorted it!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard