Different view for different users for same page


How to show user specific data ?
Lets say requester gets to see only his data whereas approver can get to see entire data.
So same page will display different set of values for different users.
I am fetching data from Sheets.



Hi Amey,

This can be achieved using an IF() formula and in the IF() formula, you need to check if current user is the requester or approver. Basis this condition, you use the desired LOOKUP() formula.

For example, let’s assume requester email is "requester@dronahq.com" and approver’s email is "approver@dronahq.com" and the column in which users email is stored is “email” in sheet “Temp”. Now, the IF() formula will be like -

IF(USEREMAIL<>"approver@dronahq.com",LOOKUP([Temp.unique_id], Temp.email=USEREMAIL),LOOKUP(Temp.unique_id]))

The explanation of the above formula is -
USEREMAIL - this is a DronaHQ Studio keyword which will fetch the logged in user’s email address
LOOKUP() - will fetch data from sheets
IF() - this function will check if the USEREMAIL is not equal to (<>) to "approver@dronahq.com", then the formula LOOKUP([Temp.unique_id], Temp.email=USEREMAIL) will be executed, otherwise, LOOKUP(Temp.unique_id]) will be executed.

Hope this fulfills your requirement.