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?
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
Rahul Sahu wrote:
Hello Rahul,
The first table is fetched from LDAP authentication.
pratiksha Dabhade wrote:
than you need to filter data based on userID after login sucessfully.
Hi,
please check this post and this document and this document. Look to this course too.
Cheers
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
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:
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