0

I have cloud page to retrieve user details from SFMC, I need one more field roles. Please help me how to get user roles.

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>
    </title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    %%[
      var @rr, @CategoryID, @email, @ActiveFlag, @CreatedDate, @UserID, @LastSuccessfulLogin,@Name,@BusinessUnit
      set @rr = CreateObject("RetrieveRequest")
      SetObjectProperty(@rr, "ObjectType", "AccountUser")
      AddObjectArrayItem(@rr, "Properties", "Email")
      AddObjectArrayItem(@rr, "Properties", "ActiveFlag")
      AddObjectArrayItem(@rr, "Properties", "CreatedDate")
      AddObjectArrayItem(@rr, "Properties", "UserID")
      AddObjectArrayItem(@rr, "Properties", "LastSuccessfulLogin")
      AddObjectArrayItem(@rr, "Properties", "IsAPIUser")
      AddObjectArrayItem(@rr, "Properties", "Name")
      AddObjectArrayItem(@rr, "Properties", "DefaultBusinessUnit")
   
      set @rows = InvokeRetrieve(@rr, @rrStatus, @rrRequestID)
      for @i = 1 to RowCount(@rows) do
      set @row = Row(@rows, @i)
      set @email = Field(@row, "Email")
      set @ActiveFlag = Field(@row,"ActiveFlag")
      set @CreatedDate = Field(@row, "CreatedDate")
      set @UserID = Field(@row, "UserID")
      set @LastSuccessfulLogin = Field(@row, "LastSuccessfulLogin")
      set @IsAPIUser = Field(@row, "IsAPIUser")
      set @Name = Field(@row, "Name")
      set @DefaultBusinessUnit = Field(@row, "DefaultBusinessUnit")
      UpsertData("AcctUser_Report_Final",1,"UserName",@UserID,"Email",@email ,  "LastLoginDate", @LastSuccessfulLogin, "Status", @ActiveFlag , "isApiUser", @IsAPIUser , "Name" , @Name , "CreatedDate", @CreatedDate, "DefaultBusinessUnit", @DefaultBusinessUnit)
      next @i
      ]%%
  </head>
  <body>
  </body>
</html>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.