I really don't know that much about PowerAutomate and very little about coding. Everything I have figured out has been through searches, forum posts and trial/error.
Here is what I am trying to do:
- I have multiple pages in SharePoint.
- At the bottom of each page I want to include a webpart button that acts as an attestation (e.g. "By clicking this button I have read this page").
- When a user clicks on that button, I want to record in a SharePoint list
A. The current date/time
B. The user's username
C. The URL (or some kind of identifier) for the page the button was located on. Each page would have its own identifier.
I have A and B working, but can't figure out C.
Here is what I have done:
1. Set-up a Page in SharePoint ("Page1.aspx")
2. Set-up a List in SharePoint ("Completion Tracking" with columns "Title"; "Completion Date", "Username", and "Referral Page")
3. In PowerAutomate defined the trigger "When an HTTP request is received" with GET method
4. Added step "Get my profile (V2)"
5. Added step SharePoint "Create item" and configured it for the "Completion Tracking" list to
a. Add "guid()" function to "Title" column
b. Add "utcNow()" to "Completion Date" column
c. Add "displayName" to "Username" column
6. When I save my flow, the HTTP GET URL is generated
7. I add that URL to the webpart button on the SharePoint "Page1.aspx" page
8. When I click on the button, the flow is triggered, and data is written to the SharePoint "Completion Tracking" list.
All of that works just fine.
For the "Referral Page" column data, I was hoping that either:
A. I could somehow get the URL of the referral page. But I don't know if that information is even being passed along with the GET request when the user clicks on the button webpart. OR
I have hit the wall. Any suggestions how I can get this done? Next question -- the page that loads after the button is clicked is a blank page. Any suggestions on getting that page to auto close or adding a message to the user to close the page?
Thanks.