Objects in Javascript context

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
JoshK131
Posts: 42
Joined: Tue Jan 26, 2021 11:09 pm

Objects in Javascript context

Post by JoshK131 »

I want to use some specific user selected object to dynamically control how queries are displayed.

I am unable to find a way to get the ID of the logged in user or any other object in a script.

In my mind, If i can get the ID of a user selected object, then I can get its attribute values and use them to change the query.

This is for query Panel operations Execute Javascript.

My approach may be wrong or maybe the question is not clear, but I would like some help please.

Thanks
JoshK131
Posts: 42
Joined: Tue Jan 26, 2021 11:09 pm

Re: Objects in Javascript context - Solved

Post by JoshK131 »

Solved by with Execute Javascript in the VP First Command and storing it in local storage.

var userId = parser.m_userPrefNode.attributes["user_id"].value;

// Save the user ID to local storage
localStorage.setItem("userId", userId);

console.log("User ID saved:", userId);
Jaymer
Posts: 2461
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Objects in Javascript context

Post by Jaymer »

LoggedInRegularUser.ID
Gives you that value
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply