configurationdynamics-crmrelationshippowerapps-portal

How can I show the logged-in user in Power Apps Portal what their form submissions are?


The setup

I have a Power Apps Portal with the following pages:

  1. Prequalification page. This has an entity form embedded inside it. The entity form is linked to the custom entity SupplierPrequal. When the user fills in and submits that form, they are redirected to the next page.
  2. Submission List page. This has a List embedded inside it. The list should show each of the logged-in user's form submissions.
  3. Submission Edit page. This has an entity form embedded inside it. The entity form is linked to the same custom entity SupplierPrequal and lets them attach files to a previous submission.

The problem I am facing

On the Submission List page, it shows submissions of users other than the logged in user. Here is a screenshot. You can see that the metadata for fields like [Created By] does not identify the user who submitted the form.

I was able to autopopulate the field [00_lkp_UserSubmittingForm] with the logged in username. Unfortunately this is not a unique identifier, and is also editable by the user.

enter image description here

I see these potential solutions, and would appreciate your advice

What I've researched


Solution

  • If I understand your problem statement you wish to filter out Entity List, in your case Submission List page based on your logged in user.

    As you might now, every user in Portals is a Contact record in CRM.

    If I see your createdby, modifiedby and owner fields, I believe you have some background logic which runs under System (user) and does the required.

    You have 2 way to solve your issue:

    1. Either change your background logic to run under the context of running user. This will createdby, modifiedby and owner as running user and not System.
    2. or you create a lookup field 00_lkp_UserSubmittingForm I say lookup and not plain text field. This lookup field will have relationship with contact. So you can autofill this field (lookup) with contact as user. In this way you get unique value in your 00_lkp_UserSubmittingForm field. Because it has unique guid for each user (in turn a contact)

    Now with above any method what you get is current user (unique).

    Then you can follow any of the below article to solve your issue.

    1. List item

    In Entity List itself, there is one option to add Filter Condition. Please check below: Article Ref enter image description here

    1. Or follow this article