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 / Sharepoint back-end --...
Power Apps
Unanswered

Sharepoint back-end -- how to support "Allow user to create, but view only their own records"

(0) ShareShare
ReportReport
Posted on by 292

I hoped to:

  • Create a custom permission set with only "Add" that would granted to all users.
  • Assign "View" permission to the creator for this one record as part of on-create trigger 

The catch:  Sharepoint doesn't allow you to do an Add without automatically checking Edit permission as well,  and that automatically forces checkmarks on "View web page"  -- I do not want "add-only" users to have the ability to view the whole list in "raw" Sharepoint.  

 

I'd rather not do the  two-table approach -- a "new records" and "real main" table.  (Users contribute new records to the first table which automatically moves them to the Real Main table to which they no explicit access beyond the specific records shared with them. 

 

IS IT POSSIBLE:  to use two SharePoint connectors in a Power Platform App?   Can you direct which connection to use for a specific action?  Use one connection to Read/View data, and a different one to do Patch/Add/Save?

1. List permission:   

  1. CRUD permissions granted to the Service Account.   
  2. No List-level permissions granted to users -- their accesses are solely from Shares 

2.  In the Canvas App :

  1.  Have two SharePoint connection references  --  one using the user's credentials, one using Service Acct.
  2.  Populate Gridview using the User-account connector  so it only shows what's been shared with the user.
  3.  Perform Patch/Add/Save data operations with the Service Account. 

 

This would accomplish the "illusion" users can add items  (they can, just not under their own credentials) and that they can view their own items (which they can but only on a Share basis).

Categories:
  • WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    Hi @MelissaReed ,

    You are on target with the Service Account idea - you can configure the "run only users" to use the service account for any writing and then set whatever permission you want on the List for the users in the custom permission group..

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • MelissaReed Profile Picture
    292 on at

    I did try this on a COPY of my app.   

    As Setup,

    In my solution, I created the separate env variable pointing to my ProcessTicket  list using my Svcs Acct SP Connection Reference.   

    In my App,

    I created a new data connection, referencing that new environment variable pointing to ProcessTicket using Svc Acct.

     

    In the form's Datasource property, I put in

    If(Form_Add.Mode=FormMode.New,
    'envar-ApprovalTool-ProcessTicket_SVCACCT' ,'envar-ApprovalTool-ProcessTicket')

    So if I was in New Mode, the Submit(form) would use my ServiceAcct Connection  

     

    When I did this (I already have Contribute position on the list), it worked perfectly and stamped Created By with my Service Account ID, which tells me it used the right connector.   

     

    When my "regular" use did this, (who has no list-level permissions), she got an error saying "you do not have permission to create this item.

     

    When I grant her Contributor access, it works perfectly (Created By is Service Account).

     

    What the tells me is somewhere in the bowels of this thing it isn't just about Patch/Add, but before it does that, it's checking RuntimeUser's permissions on the list about to be patched.   (not the connection that is being used for the patch).     A bug perhaps?

     

    I cannot stomach having two tables -- one that's a short-lived landing pad that moves the item (w/f) to the "real" table.

    I considered putting calling a WF calls before/after Submit to give the runtime user Add permission, then revoke it.   But if I'm going to call a WF anyway the more secure approach would be:

    REPLACE Submit(form) with a call to a Power Apps Workflow, passing in the fields from the form (it's not a complex form), and inside the workflow run a SP/Create New Item step using Service Account connection string.  We'll see how it goes....   

     

    I was so close with that If() on the Datasource but for some reason it still wanted to consider the runtime user's access first before executing the Add using ServiceAcct connection..  Grrf!

     

  • WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    Hi @MelissaReed ,

    I am a little unclear on exactly what you have done here, but if that table is in any way connected to the Power Apps (other than in the connected Flow using the Run only user connection of the Service account), the user needs some access. The conditional data source in Power Apps just will not work as the authentication is done when the user first opens the app.

  • MelissaReed Profile Picture
    292 on at

    So my core need in this was allow users to Add to the SP list, but without giving them Edit/View permissions on that list.  

    • Sharepoint does not support this -- it will not allow you to give Add permission without also giving Edit/View permission.  Even on "custom permission sets".   
    • Service Accounts aren't an option in Canvas Apps -- Data sources connect using only the runtime user's credentials, overriding any connection reference or env var set up.   

    I did NOT want to create a 2nd, cloned, table that allowed Adds (and then write workflow code to move it to the 'real' table).  

     

    So what did work for me, using just one SP List.

    Instead of Defaults(datasource), manually create my own Defaults record

    Instead of SubmitForm() or Patch(), call a Power Apps workflow to add the record using a service acct

     

    Details

    1. In the Canvas App "Add" button / On Select,  

    Defaults(Datasource), won't work when the user doesn't have permission to the datasource (list)

    Instead, define that "default" record manually in App/OnStart, or /Formulas)  and plug it  in here:  

    MelissaReed_0-1719319770861.png

     

    2.  Create the P/App workflow that will Create New Item-- "PowerAppsSaveProcessTicket" in my example

    a. Trigger is Power Apps, add a String parameter to receive the record string built in the app

    b. Convert that string to an object using JSON  (Google how to do this if you need detail)

    c.  Create the record, using an account that DOES have Add permissions to this list.  In my case it's a Service Account:

    MelissaReed_3-1719322664479.png

    d.  Don't forget to add Power Apps response blocks  -- that's how it passes the new ID back to the Canvas App as well as any error handling 

    MelissaReed_4-1719322797525.png

     

     

    3.   Go back to the Canvas Flow and add the call to this workflow

    a.  DON"T FORGET TO ADD THIS FLOW TO YOUR APP before trying to reference it!

    b.  In your "Save" button's On Select, replace SubmitForm() or Patch() by calling calling the workflow you just created.   

    MelissaReed_2-1719321856877.png

    First build (as text) the data record to be passed in   (can't pass in an object, so pass in a string)

    Next run the workflow, passing in the text "record" you just built. (it will convert the string to an object)

    Check the return code   (similar to SubmitForm's   OnSuccess/OnFailure, except it's all handled here.

     

    This is working well for us.   

    Thanks @WarrenBelz  for your help getting me to understand Power Apps data connections use the runtime user's credentials NO MATTER WHAT  (ignoring connection references, environment variables).     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 226 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard