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 / Collect Function namin...
Power Apps
Answered

Collect Function naming problem

(0) ShareShare
ReportReport
Posted on by 56

I'm having an issue using the normal column names in my collect function when trying to write to a sharepoint list.  Its telling me on the button where the collect function is triggered onselect, that the column does not exist.  The names match both in the app and the sharepoint list.  

Problem:

Collect(
CollectShiftReport,
{

'Date and Time of notification': DataCardValue3.SelectedDate

}

);

Collect(
'Shift Report',
CollectShiftReport
)

No Problem:

Collect(
CollectShiftReport,
{

'OData_x0023_x0020_Date_x0020_and: 'DataCardValue3.SelectedDate,

}

);

Collect(
'Shift Report',
CollectShiftReport
)

 

Why do I have to type the crazy long name in???

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @long 

    Can you explain a little more about what it is that you're actually trying to do?

    You mention "writing to your sharepoint list"...but this is not the method to do that.

  • long Profile Picture
    56 on at

    I’m collecting data from three different forms on three different screens.  Using the collect function with a button ( onselect  using the collect function as I previously explained) on screen four to add all the data to a collection, then using the using Collect(share point list name, CollectShiftReport) to send it to my share point list.  Why is that not the correct way to do it?  Is there a better way?

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @long 

    Because Collect creates collections.  Patch or Update/If are the only functions that will push/write data to the SharePoint List.

     

    Your formula has a "DataCardValue3" control name listed in it.  This leads me to suspect that you have multiple screens with EditForms on them.  In this case, you can actually just use the built-in ability of Forms to update your SharePoint list.  No need to collect and then try to submit.

     

    Take a look at this posting and the accepted solution.  It sounds similar to your needs.

     

    At any rate - you're going to have to SubmitForm, Patch, or Update/If  your list.  Collect will not do anything for you except make a collection.

     

    Hope this helps shed some light.

     

  • long Profile Picture
    56 on at

    Ok So I used your recomendation using the form functions (which does make sense) I used NewForm and  SubmitForm(StartShiftForm); SubmitForm(EquipmentCheckForm); SubmitForm(StatsForm), I have set the forms to edit mode and set the datasource for each form to my sharepoint list.  I have left item blank which I think is a problem, not sure.  My results are three entries in the sharepoint list, with data in each one from the forms??  Not sure how to get all the info on one line.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @long 

    So take a look at that solution again. You will notice that on the final form is when all the submits are made. 

    I would recommend that on multi-screen form entries - then it's quite simple.

    If that is not an option, then you have a little more work to do.

    You would need to use the LastSubmit property of your first form to "feed" the subsequent forms.

    So, Form1, you do your submit.  

    For Form2 and beyond, you set the Item property to Lookup(yourSharePointList, ID=Form1.LastSubmit.ID) then when you Submit those forms, they will be working on the same item in your SharePoint list.

     

    I hope this makes sense and is helpful.

  • long Profile Picture
    56 on at

    Here's what I ended up with thats works great.  I took the three forms that are on three seperate pages and used the patch function below trigger by a button on the last page.  This takes all the form info and places it into one record on the sharepoint list.  Then reset each page and navigated back to the start screen. Thanks Randy for all you help, I really appreciate it.

     

    Patch(
    'Shift Report',
    Defaults('Shift Report'),
    StartShiftForm.Updates,
    EquipmentCheckForm.Updates,
    StatForm.Updates
    );
    ResetForm(EquipmentCheckForm); ResetForm(StartShiftForm); ResetForm(StatForm);
    Navigate(StartScreen,ScreenTransition.Cover)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard