15 Mar 2022 12:07 PM - last edited on 16 Mar 2022 08:34 AM by MaciejNeumann
I am creating a custom action in my Swift (MOBILE) App as described in the documentation :
let myAction = DTXAction.enter(withName: "My action")
myAction?.reportValue(withName: "My int value", intValue: 1234)
myAction?.reportValue(withName: "My double value", doubleValue: 12.34)
myAction?.reportValue(withName: "My string value", stringValue: "Hello World!")
myAction?.leave()
My question is: How do I get the values that have been reported above within Dynatrace, as well as via your API?
I can see the Action called "My action" within the dashboard, and I can get metrics from the action by making it a Key User Action, but I cannot seem to get the values for that action: e.g. "My int value" etc.
Please help
Solved! Go to Solution.
16 Mar 2022 01:04 AM
Hey ajkinetic,
I've set something up in my own environment to hopefully show you a couple of ways you could get these values. Firstly the reported values can only be found within the waterfall analysis for the action unless you configure your environment further.
So firstly to see these values and make sure they are in fact making their way into your environment find your action in a user session and then click the dropdown for it and then go to the waterfall analysis.
Once in the waterfall analysis all reported values should show up here underneath the action timeline.
Now if you want these values to be accessible from the user session query feature or through the API you need to define it as an action property or session property.
In my example above I have a property called Location, in your example you would set the "Name" field to be "My string value" or "My int value" as that is the name you gave your values in your code. The property details like the key are for viewing and getting the values in Dynatrace which you will see below.
After setting the properties generate some new traffic and then you can check that it worked in the user session query.
SELECT usersession.userSessionId, usersession.userId, useraction.name, useraction.stringProperties.location FROM useraction WHERE useraction.stringProperties.location IS NOT NULL
The above is an example of the query I used to see my location property being reported.
Hopefully this helps to get your started!
16 Mar 2022 09:14 AM
@Fin_Ubels thank you, this is what I was looking for.