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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Submitting to Sharepoi...
Power Apps
Answered

Submitting to Sharepoint List with Button & Capturing Entry

(0) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    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.

  • timothymckinney Profile Picture
    4 on at

    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.

     

  • Verified answer
    v-jefferni Profile Picture
    on at

    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.

     

  • v-jefferni Profile Picture
    on at

    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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard