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

The setup
I have a Power Apps Portal with the following pages:
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.
Submission List page. This has a List embedded inside it. The list should show each of the logged-in user's form submissions.
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.
I see these potential solutions, and would appreciate your advice
Change the metadata so that instead of recording the field [Created By] as "SYSTEM", it will record the logged-in user's unique identifier. Then change the view's filtering conditions, so [Created By] equals the current user.
Change the metadata so that a new field such as [00_lkp_UserSubmittingForm] will be autopopulated with the logged-in user's unique identifier. Then change the view's filtering conditions, so that new field equals the current user.
I suspect that both these approaches will require a lookup of the [External Identity] entity's field [Username]. They will probably involve configuring the entity form's tabs "Entity Reference" and "Entity Form Metadata" in Portal Management.
What I've researched
This link describes a similar problem, although the solution is for a CRM Portal, not a Power Apps Portal.
This link addresses the issue for a Canvas App, not a Portal App
This link apparently got it working, although I am still trying to understand what I need to configure.

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:
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.
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.
List item
In Entity List itself, there is one option to add Filter Condition. Please check below:
Article Ref
Or follow this article

Related

Dynamic field creation google forms

Is it possible to add questions to a google form based on if the user wants to add a few more clusters of data?
i.e. a user is asked to enter information about the pets they have. If they have one pet, a user enters information for one pet. if the user wants to add another pet, they are prompted and asked if they want to add another pet. The user then selects yes, and another few fields appear.
When the user is done adding pets, they say they are done, and move on.
I assume using a class form would allow me to add a text field, but is there an issue with how the information is pushed to the spreadsheet?
This example says that although you can add fields, you cannot capture the data into a spreadsheet since they are already formed.
How can I add dynamic field in Google Form?
Thanks
We were able to resolve this by using the native structure of google forms by adding a separate section for information gathered for the data row set.
At the end of the product section, if the user wishes to add another row of data, for us, it was another product, one adds a multiple choice question which prompts the user to either add another product, or to move to the final step (submit or adding shipping info or whatever).
If the user elects to add another product, it jumps to the next section, if not, it jumps to the ending section, in our case, procurement info. The ability to jump from section to section is available through the selection menu on the three vertical dots next to the question.
The limitation is that the creator of the form must copy the repeated section the number of times a new product can be added.
Once this is complete, the script in the spreadsheet the form is linked to, iterates through the columns and plugs it into the document.

View Custom Field Passed with GetResponse Form

I'm passing document.referrer to GetResponse when a user submits the subscription form. The custom field has been added to the form at runtime as instructed in this document and the "Forward Data" option is on. Upon form submission, the parameters are posted correctly. Problem is, the value doesn't show up anywhere in the user's details in GetResponse, where it would be most useful. Where can I retrieve it?
I'm answering my own question s I've found the solution by trial and error. Not even the support people at GetResponse were able to help.
Apparently, only the custom fields that are actually added to the form designer get recorded. So if you use a custom form (not created with designer), on top of adding the <input> fields in your code, you'll have to create them first (dashboard > contacts > custom fields) and add they'll appear in the designer as well (on the right side).
After that, the passed values will show up in the contact's detail card. To retrieve the values for more than one contact in bulk, you'll have to export the contacts to csv, xml or xls, as support says there is no way to display additional columns on the contacts page. The alternative, if you are looking for a specific value, is to filter by the custom field on the contacts page (left side, 'add custom field').

Getting avatar URLs for other users.

When retrieving comments made on a Box file, the comments may have been made by a user other than the current user.
The comment object contains the user name and id, but not the avatarUrl.
Making a call to users/me works for the current user.
I tried users/userId for another user (the one who made the comment), and it does not seem to work.
Is there another entry point to do this ?
Nope - you can only access the authenticated user's information.
If they opened the API call to any user, then a malicious attacker could download all of box's user information. I realize this is not your intent - this is just Box trying to protect itself.

Google Apps Script: Access the form key that allows user to edit their responses

With a Google Apps for Education domain, we can create forms that allows users to edit their response.
This sends a link to the submitter with the url that they can use to edit their response. Essentially this is the url of the form with a unique key at the end.
At the time of submission, I would like to be able to collect this key and store it with the form data for each user.
We are creating an Alumni website (where all users will be authenticated to our domain), and we'd like to have an update my profile page. This would be blank the first time the user submits. But then when they come back, I'd like a script to search the username against submitted entries, and if the user is found, direct them to the link that allows them to update their profile.
At the time of first submission, Google automatically sends the url to the user. However, t is unlikely that years later, they will stil have this email, so if we could provide the link for them, it would be far easier for the user.
I have similar problem. One way to solve, is to implement a Gmail plugin(if all users are gmail users). The plugin can parse the message (extractor), and get the key/or the whole URL. But you need to saveit on some database, in order to have acccess later.
If we got some way to list form keys, it should be much better!

How to update DB records using a dynamically generated link

I have a requirement to generate an email to administrator whenever a user sign up. Administrator will approve the registration by clicking on a link provided in email and database should get updated, without admin to login to administrator console.
I am looking for best practice to code this scenario with keeping application security intact. I can generate email with dynamic rendom value attached to the link(provided in email) URL, but i am not sure how to keep a track of this on application side?
Any thoughts?
You could generate a random validation number when the user signs up, and store it in the database with the user record. Then generate an email with a link such as
http://foo.bar.com/approveUser.action?userId=<theUserId>&validationToken=<theRandomNumber>
When the approveUser action is invoked, check if the validation token stored in the database for the given user ID matches with the token sent as parameter, and if so, approve the user.