If you want to keep this object global, you can create a association with user entity and upon receving the output via the rest call simply update the association and commit and that will do it. You will now can access the response object anywhere in the session by retreving it from the [%currentuser%] token.
You cannot create a custom session variable in Mendix. Refer this question this is similar to you scenario https://forum.mendix.com/link/questions/92757 . Hope this helps!
Thank you for reply.
I actually do not have a user entity, neither any other persistable entities at domain level. To test the Rest call, i just used call rest object in the microflow. All used entities are non persistable
I attached some screen shots
I need to save replyAPI
I was unable to get the association replyAPI_User to save the variable replyAPI into it
i could progress by the following
i was however unable to call the replyAPI in other microflows
I was unable to create the xpath on the micorflow, how can i do that?
Anyway, I created a grid on the page, but got the errors
[MyFirstModule.replyAPI_User/MyFirstModule.replyAPI/MyFirstModule.replyAPI_User/System.User/id = '[%CurrentUser%]']
I got the following errors when making the 1 to 1 relationship
I still could not progress. please send me more details on the solution.
To sum up, i created a non persistant entity and associated it to User.
I do a call Rest and output it to the non persistent entity
I then associate it using create object
I need to call that entity in another microflow
I tried the following in another microflow
all the variables in the entity are empty
Hi Mohammad Reza Dowlut,
Firstly instead of creating association to system.user you can also create a assoication to system.session object.
After the post Rest call is done you wil get an object Login.Reply. Next to post call use a change object on Login.reply and in the LoginReply_Session assoicaiton set the $currentsession token. Instead of create object you should do a change object object on the LogiReply object.
Now you can retrieve the LoginReply obejct with your current session token in the microflow.