Best performance use [%CurrentUser%] or retrive UserAccount from Database?

Hi! In or App we do a lots of Chech against UserAccount so my question is if we should Use a retrieve User Account or use '[%CurrentUser%]' .   We have 3 option, We are looking to optimze performance. 1. Use '[%CurrentUser%]']  in the Xpath 2.  Use a retrive to get UserAccount and use that in Xpath 3. Use  a Pageparameter and pass it thru every sub MF   Is theres a difference if we need Ones in MF or if we will do some Check in a Loop and use the Account check multiple times?     Option 1 Option 1 Retrive and use that in Xpath
2 answers

Hi Olle Lindgren,


As we already know, there are multiple ways to check with the current user in the conditions or xpath.


1. By using '[%CurrentUser%]' , you are not getting any thing from database.

This is the local variable available in the microflow. so using this one will be efficient one in terms of memory usage.


2. Using Retrieve action of Administration Account entity, you are interacting with the database to retrieve the user account info. So this does a extra memory usage even with the information of current user in the local variable i.e., '[%CurrentUser%]'  and some times you will get available with the variable $CurrentUser also. These are available by default in every microflow without any interaction with the database and any extra memory usage.


So, Usage of '[%CurrentUser%]' Variable is efficient than any other way of using current user with no extra memory usage and optimization. 


have you try this one ? and use it as subfow .