Can't access pages that are set on anonymous when not logged in

so I have a page that is set on anonymous to allow user to register if they don't not have an account but whenever I try to access this page when I am not logged in I get the There was an error processing your request. Please try again later error. now when I am logged in the page works fine with no issues.

Hi joharah k,


The Error - "There was an error processing your request. Please try again later." is occured because of many reasons. But in your case, I can surely say that, the error caused because of the called GetUser() function which is defined in the UI canvas area (may be in Title Placeholder section)

As mentioned below:

Code Snippet

GetUser(GetUserId()).User.Name


When the page is accessed by an Anonymous user, the built-in function GetUserId() will return Null value, which is passed as an input parameter in GetUser() entity function, because of which the error occurred. Place such expressions conditionally as shown below.


Code Snippet

If(GetUserId() = NullIdentifier(), "", GetUser(GetUserId()).User.Name)


Hope this helps you!


Regards,

Benjith Sam

Benjith Sam wrote:

Hi joharah k,


The Error - "There was an error processing your request. Please try again later error." may occurs because of many reasons. But in your case, I can surely say that you are calling/using the GetUser() function in the UI canvas area (may be in Title Placeholder section)

As mentioned below:


Code Snippet

GetUser(GetUserId()).User.Name


When the page is accessed by an Anonymous user, the built-in function GetUserId() will return Null value, which is passed in GetUser() entity function as an input parameter, because of which the error occured.


Place such expressions conditionally as shown below.

Code Snippet

If(GetUserId() = NullIdentifier(), "", GetUser(GetUserId()).User.Name)


Hope this helps you!


Regards,

Benjith Sam


So it is working now but I want to share with you what I did just incase theres something I should look out for (If thats not to much trouble)

What I ended up doing the fixed the issue for me is adding the registration page in the to menu block and it seemed to work after doing that . 

I will also add what you have said cause it does seem like it might cause issues.

Hi joharah k,

Sorry, I'm not able to understand the below mentioned solution statement:

What I ended up doing the fixed the issue for me is adding the registration page in the to menu block and it seemed to work after doing that .


The error log which you posted previous clearly states that, somewhere in your code - ProfileID = 0 (null value) is getting passed as an input parameter while referring the getProfile() entity action.

Solution:  By defining such expression conditionally on the basis of ProfileID value, you can handle the run-time occurring code break. 


Regards,

Benjith Sam