Get a user stamp for approvals
Hello Anaplanners,
I have a dashboard that allows users to approve or reject requests. I would like the User name to be stamped somewhere (probably a line item) once they choose to approve / reject.
Example: Cost Center 100 is requesting 1 more Employee for Job: Developer. It needs approval from Manager, HR, and Finance. As each of them click the box, I want the specific user to be stamped and also be visible in UX.
Any suggestions?
Best Answer
-
To get the date there are many process mentioned in the site below.
For user id you could use the below code.
import requests
# Set the Anaplan API credentials and endpoint
base_url = "https://api.anaplan.com"
workspace_id = "Your Anaplan Workspace ID"
model_id = "Your Anaplan Model ID"
user_name = "Your Anaplan User Name"
password = "Your Anaplan Password"
# Authenticate and get an access token
auth_url = f"{base_url}/auth/oauth/token"
auth_payload = {
"grant_type": "password",
"username": user_name,
"password": password
}
auth_response = requests.post(auth_url, data=auth_payload)
access_token = auth_response.json()["access_token"]
# Make a GET request to the Users API endpoint
users_url = f"{base_url}/1/3/workspaces/{workspace_id}/models/{model_id}/users"
headers = {
"Authorization": f"AnaplanAuthToken {access_token}"
}
response = requests.get(users_url, headers=headers)
# Extract the user ID from the response
users = response.json()["users"]
user_id = None
for user in users:
if user["name"] == user_name:
user_id = user["id"]
break
print(f"The user ID is {user_id}")for getting other id's required in the code, you can refer to the
0
Answers
-
There is no way in Anaplan to do this currently. The closest thing is the inbuilt history feature using which you can right-click on any (non-formula) cell and using the show history feature, view the exact changes made. However, there is no way to get this data into another line item.
You can also refer to the below thread with the similar issue.
0 -
Thanks @rishi8118
I'll try the solution given in other thread. Do you know what that python script should be to get current date and user?
0 -
@rishi8118 Thanks for the details! Will work on this.
0