How to use record/findone for PortalUser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ednt
    Member
    • May 2022
    • 56

    #1

    How to use record/findone for PortalUser

    Hi,

    There is no entity PortalUser, since they are inside of User. Ok.
    But if I try to find a PortalUser via script, it fails.

    Code:
    $portalUserId = record\findOne('User', 'createdAt', 'desc', 'name', 'du8f9-z7ff7');
    output\printLine($portalUserId);
    null
    But the PortalUser du8f9-z7ff7 exists and if I search in the PortalUser GUI, I find it.

    Click image for larger version

Name:	Clipboard_07-15-2025_01.png
Views:	13
Size:	17.9 KB
ID:	119424

    Any idea how to find a PortalUser via script?

    Best regards.
    Last edited by Ednt; Yesterday, 10:05 AM.
  • lazovic
    Super Moderator
    • Jan 2022
    • 1103

    #2
    Hi Ednt,

    Please try to use the following formula script:
    Code:
    portalUserId = record\findOne('User', 'createdAt', 'desc', 'userName', 'du8f9-z7ff7');
    output\printLine($portalUserId);

    Comment

    • Ednt
      Member
      • May 2022
      • 56

      #3
      Thank you very much!

      userName did the trick.

      Comment

      Working...