Jump to content
  • 0

Login Redirect for Report DataPages?


kpcollier

Question

Here is my idea.

I have an Orders App. It contains a submission form and a report datapage. The table for this app has a field named Ordered_By, which gets its data from a separate Employee Table that holds all of our employee information. This field is to filter the orders by the user who made the order.

Is it possible to have a user login and have the Report Datapage already filtered to orders placed by the logged in user? i.e., KPC creates an order from the submission form. KPC then goes to the Orders Report DataPage, and instead of using the dropdown to find his name in the search, the report is already populated with orders placed by KPC.

I appreciate the help!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hi @kpcollier,

 

I believe that what you need to do is to set up a Record Level Security on your Reports DataPage. 

It allows you to restrict access to records based on the current user’s profile data.

With record level security, you can allow access based on:

  • Records that were created by the current user
  • Records that were assigned to them personally

You have to set an authentication and choose Filter data based on your pre-defined criteria and enable RLS. Please see screenshot below. 

image.png.03030bb17252ec3edf2c6b5aebb29244.png

 

For more information about RLS you can refer to these links: 

https://howto.caspio.com/authentications-and-connections/authentication/record-level-security/

https://howto.caspio.com/getting-started/record-level-security-stamping-new-records/

 

Hope this helps.

 

Thanks,

kristina

Link to comment
Share on other sites

  • 0

Hi @kpcollier,

 

As I understand, the few superusers you are referring to are the admins. It is possible by creating another Reports DataPage but in this, you will not enable the RLS so that they can view all the records. 

You will need to have a Standalone Login Screen which redirects the user based on Role. Here is the link on how to set this up: https://howto.caspio.com/tech-tips-and-articles/common-customizations/create-user-specific-redirect-after-login/

 

Regards,

kristina

Link to comment
Share on other sites

  • 0

Okay. The reason I want this feature is for UX/UI for the users in our company. I don't necessarily want to lock them out of the other records that do not belong to them - I would just like their records to pop up at first, and have the ability to see others if they need to.

I was thinking I may be able to do this with a button that links to the Superuser, but I'm not sure if it will mess with redirection and authentication. 

Link to comment
Share on other sites

  • 0
On 12/6/2018 at 2:35 PM, kpcollier said:

Okay. The reason I want this feature is for UX/UI for the users in our company. I don't necessarily want to lock them out of the other records that do not belong to them - I would just like their records to pop up at first, and have the ability to see others if they need to.

I was thinking I may be able to do this with a button that links to the Superuser, but I'm not sure if it will mess with redirection and authentication. 

 

Hey @kpcollier,

 

If this is the case, just disable RLS. Then in your Reports DataPage, set the Ordered_By field to receive a default value from an Authentication Field.

 

image.png.a68d7dabd1aca576658b9659b2a9c61d.png

 

 

==

Another approach and slightly unrelated.

You may also try this neat trick. Just add a calculated field, 

CASE 

WHEN [@field:userId] = '[@authfield:userId]' THEN 1
ELSE 0 

END

 

Sort your results

image.png.32c2f112918b16fc1edcb88523e0ca7c.png

 

Then hide the Calculated Field column: https://howto.caspio.com/tech-tips-and-articles/common-customizations/how-to-hide-fields-in-datapages/ (via HTML Blocks)

 

This way, the user's records always comes first, unless you filter it out.

 

Hope this information helps.

 

Happy Holidays, Cheers !

-DN31337

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...