# Capturing userid with two specific consecutive user actions

**URL:** <https://community.dynatrace.com/t/capturing-userid-with-two-specific-consecutive-user-actions/36973>\
**Category:** Open Q&A\
**Tags:** user-actions, usql\
**Created:** [October 20, 2022, 8:38am UTC](https://community.dynatrace.com/t/capturing-userid-with-two-specific-consecutive-user-actions/36973 "2022-10-20T08:38:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [October 20, 2022, 8:38am UTC](https://community.dynatrace.com/t/capturing-userid-with-two-specific-consecutive-user-actions/36973/1 "2022-10-20T08:38:16Z")

</div>

Hi,

We want to extract the userid that have clicked on two useractions. These useractions must be appear consecutive.

I’ve read here

> **[Custom queries, segmentation, and aggregation of session data in RUM Classic](https://docs.dynatrace.com/docs/observe/digital-experience/rum-classic/session-segmentation/custom-queries-segmentation-and-aggregation-of-session-data)**
>
> Learn how you can access and query user session data based on keywords, syntax, functions, and more.

that Ordering is partially supported

How can we do to get this?

Thanks in advance.

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [January 20, 2023, 2:50pm UTC](https://community.dynatrace.com/t/capturing-userid-with-two-specific-consecutive-user-actions/36973/2 "2023-01-20T14:50:37Z")

</div>

[@erh\_inetum](https://community.dynatrace.com/user/40722)&nbsp;were you able to get a solution to this? This should be able to be completed by having the USQL select the User ID where the user actions are (Action1) and (Action2). Granted you might need to do some tweaking as this is very generic.

SELECT userId FROM usersession WHERE useraction.name IS “\<ACTIONNAME\>” AND useraction.name IS “\<ACTIONNAME\>”

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [January 23, 2023, 5:44am UTC](https://community.dynatrace.com/t/capturing-userid-with-two-specific-consecutive-user-actions/36973/3 "2023-01-23T05:44:50Z")

</div>

**Hi [@ChadTurner](https://community.dynatrace.com/user/14877) . I’ll test it and I’ll tell you.**

**Thanks!**
