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

Community site session details

Session Id : 9xkKsXsSrXm7Z0eIR8HaMq
Power Apps - Building Power Apps
Answered

Submitting to Sharepoint List with Button & Capturing Entry

Like (0) ShareShare
ReportReport
Posted on 16 Feb 2021 06:23:33 by 4

I may be doing this all wrong, but I currently have a power app that collects user and location data {Lat, Long, Altitude, UserEmail etc} and I am adding the data as an entry in a sharepoint list by using the collect() function. I then want a form shown bellow that shows the last submission. I know how to tie the form to a gallery but I am not sure how to get the form to show the entry from the button.

 

I have tried to add an additional collect to capture the entry like this:

 

ClearCollect(SPEntry, Collect('Job Combo Locks',{Title: JobNumber.Text, JobNumber: Value(JobNumber.Text), Lat: Lat1, Long: Long1, Alt: Alt1, SubmitEmail:User().Email, SubmitDateTime:Now()}))

 

 but for some reason the SPEntry collection is showing multiple entries (not sure where they are coming). Is there an easier way to pass the item being generated by the collect() to the form?

Categories:
  • v-jefferni Profile Picture
    on 08 Mar 2021 at 02:40:06
    Re: Submitting to Sharepoint List with Button & Capturing Entry

    Hi @timothymckinney ,

     

    Have you resolved the issue? 

    If above post helps, then please consider Accept it as the solution to help the other members find it.


    Best regards,
    Community Support Team _ Jeffer Ni

  • Verified answer
    v-jefferni Profile Picture
    on 26 Feb 2021 at 08:46:56
    Re: Submitting to Sharepoint List with Button & Capturing Entry

    Hi @timothymckinney ,

     

    Every time any one have manually modified the data source, as an App maker, you will need to refresh that data source connection so that Power Apps would retrieve correct data from that data source.

     

    If you would like to display the record submitted in Power Apps, I would recommend you to leverage an Edit Form control to submit to SP list. Link the Edit Form to the list with New Mode, Item property set to:

    Self.LastSubmit

    OnSelect of the submit button set to below:

    SubmitForm(EditForm);ViewForm(EditForm)

     

    Then speaking of clearcollect, since data source have not been refreshed, it would include all items before your modifying the list, along with new added items from collect function. As long as you refresh the connection, collection SPEntry would change to new added items that collected after directly modifying list.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

  • timothymckinney Profile Picture
    4 on 16 Feb 2021 at 15:33:40
    Re: Submitting to Sharepoint List with Button & Capturing Entry

    Thank you @v-jefferni for your reply.

     

    My goal is to populate an edit form with the last entry submitted from this specific power app/button function. Just want to make sure that this solution wouldn't end up showing any edits/entries made directly into sharepoint.

    Last(Filter('Job Combo Locks', SubmitEmail = User().Email))

    I did enter this and it works just not sure if this will include manual entries not coming from the power app?

     

     

    You mentioned using a single Collect function in the submitting button? Can you say more? My goal with the clear collect is to collect the last entry submitted by the button to then pass that to the form. Does that make sense?

     

    One thing I am confused about. When I run the ClearCollect for SPEntry the collection does not exactly represent the items in 'Job Combo Lock'. For instance, I deleted all but one entry in the actual sharepoint list ('Job Combo Lock') yet a gallery showing the SPEntry collection has many entries shown.

     

    Thanks.

     

  • v-jefferni Profile Picture
    on 16 Feb 2021 at 09:32:59
    Re: Submitting to Sharepoint List with Button & Capturing Entry

    Hi @timothymckinney ,

     

    Could you please share more details about your scenario? Would you like to populate the last submit item into a ViewForm?

     

    If so, you could set Item of the form to:

     

    Last(Filter('Job Combo Locks', SubmitEmail = User().Email))

     

     

    You could use the single Collect function in submitting button:

    Collect('Job Combo Locks',{Title: JobNumber.Text, JobNumber: Value(JobNumber.Text), Lat: Lat1, Long: Long1, Alt: Alt1, SubmitEmail:User().Email, SubmitDateTime:Now()})

     

    For your question of SPEntry collection, although you were using ClearCollect, if you have clicked the button multiple times, every time collecting the SPEntry collection would include all items collected in 'Job Combo Locks'.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find 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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2