364
Views
6
Comments
How to get data from database
Question

Application Overview-

I working on mobile app, in that for login I apply My 2 custom validations.

1- ABC is my first table,( in that I store only user id and password), 

2- XYZ is my second table,(In that multiple fields are present like Userid, username, mobile, email, address),

hence only userid which are present in both tables only those got login.


come to my requirement is I want username whose login their id. Plzz suggest me how i do this?

2026-02-26 06-29-24
Rahul
 
MVP

Hi Pratiksha.

you can join both entity "only with" and join condition like entityone.UserID=Entitytwo.UserId

And you use filter condition accordingly.

Like


regards

Rahul Sahu

2020-04-28 17-43-32
pratiksha Dabhade

Rahul Sahu wrote:

Hi Pratiksha.

you can join both entity "only with" and join condition like entityone.UserID=Entitytwo.UserId

And you use filter condition accordingly.

Like


regards

Rahul Sahu

 

 Hello Rahul,

 The first table is fetched from LDAP authentication.

2026-02-26 06-29-24
Rahul
 
MVP

pratiksha Dabhade wrote:

Rahul Sahu wrote:

Hi Pratiksha.

you can join both entity "only with" and join condition like entityone.UserID=Entitytwo.UserId

And you use filter condition accordingly.

Like


regards

Rahul Sahu

 

 Hello Rahul,

 The first table is fetched from LDAP authentication.

 than you need to filter data based on userID after login sucessfully.

 

2025-11-19 06-14-01
Miguel Verdasca
Champion

Hi,

please check this post and this document and this document. Look to this course too.

Cheers

2020-05-07 18-53-00
Rui Barradas
 
MVP

Hello Pratiksha,

After the authentication (using LDPA), you should have your login executed successfully.

You can use the GetUserId() function to filter the data from the second entity like:

XYZ.UserId = GetUserId()


This shoud allow you to filter the data from the second entity in order to get the username and the other columns of that table.


Kind regards,

Rui Barradas

UserImage.jpg
Florian Haas

If you want to retrieve the username of the user who logs in for lead enrichment, you can modify your login code to query the second table (XYZ) based on the user ID that was entered during login. If the user ID exists in both tables, you can then retrieve the corresponding username from the second table (XYZ) and use it in your app.

Here is an example of how you could modify your login code to achieve this:

  1. Get the user ID and password entered by the user.
  2. Query the ABC table to check if the user ID and password combination is valid.
  3. If the user ID and password are valid, query the XYZ table to retrieve the corresponding username for the user ID entered.
  4. Use the retrieved username in your app.

Here is some sample code that you could use as a starting point:

// Get the user ID and password entered by the user

String userId = "user123";

String password = "password123";


// Query the ABC table to check if the user ID and password combination is valid

boolean isValid = queryABC(userId, password);

if (isValid) {

    // If the user ID and password are valid, query the XYZ table to retrieve the corresponding username

    String username = queryXYZ(userId);


    // Use the retrieved username in your app

    System.out.println("Welcome, " + username + "!");

} else {

    System.out.println("Invalid login credentials.");

}

// Function to query the ABC table

boolean queryABC(String userId, String password) {

    // Perform the query and return true if the user ID and password combination is valid, otherwise return false

}

// Function to query the XYZ table

String queryXYZ(String userId) {

    // Perform the query and return the corresponding username for the given user ID

}

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.