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 Pages / Populate a field with ...
Power Pages
Unanswered

Populate a field with an 'Anonymous Contract' when user is not logged in.

(0) ShareShare
ReportReport
Posted on by 2

Hello 

New to Power Pages Management / Power Pages.

I have a form with a column called NAME which has the data type of Customer. I have successfully managed to get NAME populated with the user who is logged in to the Portal, by using Basic Form Metadata, Attributes. 

BOB007_0-1708352608970.png

Is there a way that when the form is being used by a user that is not logged in, I can auto populate the NAME column (which I will hide) with the contact of 'Anonymous Contact'? (Which I’ve created as a contact) 

BOB007_1-1708352608974.png

 

 Thanks in advance of any help.

Categories:
I have the same question (0)
  • fm_skeller Profile Picture
    277 Moderator on at

    Is this purely to show that this record was created by an anonymous user in the canvas app?
    Option 1 would be to just leave the field empty; but it's not very user friendly of course.
    A second option would be to run a power automate flow after the record has been created - check if the NAME field is still empty and if so, populate it with the GUID of the "anonymous contact".

    A third option would be to create two separate forms, 1 for logged in users that stores the user's contact id and another one storing the guid of the 'anonymous contact' - more work from a maintenance perspective. but in this way you can solve it with pure power pages functionality. You could use liquid to switch between the two forms

    {% if user %}
    {% entityform id: "<Guid of basic form that stores the user id>" %}
    {% else %}
    {% entityform id: "<Guid of basic form that stores the anonymous id>" %}
    {% endif %}

     or have two pages with web page access control rules.

  • littlefoot Profile Picture
    2 on at

    Hi,
    I appreciate your suggestions/help.
    I apologize for not mentioning that the NAME column is required.
    Therefore, option 1 is not feasible - we cannot leave the field empty.
    As for option 2, I think the NAME column has to be filled in for the form to save, so we need some way to populate it.

    Option 3, creating a separate form, sounds good.

    Would there be any other suggestions/alternatives.

  • Fubar Profile Picture
    8,346 Super User 2025 Season 2 on at

    Personally, I would create 2 Pages and two forms then use access control rules to show them to the different Web Roles.

    You could set your Mandatory to optional in Dataverse, and then on your dataverse use Business Rules or JavaScript to set it Mandatory if you need it in a Model Driven app.  For the portal you can set field that is optional as mandatory either by adding a Metadata record to the form, or via JavaScript/JQuery.

     

    If the field is optional another option is to have a realtime workflow or plugin that populates it if it is empty (if done via a plugin you can also detect the operation is coming from the Portal)

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 Pages

#1
Fubar Profile Picture

Fubar 70 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard