cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GeminiWorks
Helper III
Helper III

Can I use an if type statement or another solution to have the user name pass something different to my SQL database?

Right now, I have an app passing the username into SQL.  However, I am hoping I can somehow use the logged in users name to pass text that I identify based on their username.

 

Example:  Usernmame Bob Smith - I want Bob Smith to pass, "AgentBobSmith" to SQL.

 

Thanks.

6 REPLIES 6
AhmedSalih
Super User
Super User

@GeminiWorks you can use this: Concatenate("Agent",Substitute("Bob Smith"," ",""))

 

Regards,
Ahmed
If my reply helped you, please give a 👍. And if it has solved your issue, please consider Accepting it as the Solution to help other members of the community find it more.

Thank you but I need it to pull in the username of the user first and then change it to the name I need assigned.  Does that make sense?  Appreciate the help.

I actually went back in and replaced the "agent" with username and that pulled it in.  But the substitute command is simply adding BobSmith on to the end of the username.  Thoughts?

@GeminiWorks, can you please post your code so I can better understand?

@GeminiWorks, if you want the word Agent to be part of the string you are passing you should use something like this:

Concatenate("Agent",Substitute(User().FullName," ",""))

If you don't need the word "Agent", then simply pass Substitute(User().FullName," ","")

GeminiWorks
Helper III
Helper III

Thank you.  

 

There is no code currently other than the datacard pulling in username.  What I'm trying to accomplish is to have the username changed to the name I actually want passed into SQL based on the user.

 

So currently, 

GeminiWorks_0-1657130514025.png

Pulls in actual username.

 

What I was hoping I could do is, based on the user, I can have a different name passed to match my other databases.

 

So, if user Bob Smith is logged in, I want it to pass RobertSmith when the form is submitted to SQL.

If user, Joe Thomas is logged in, I want it to pass JosephThomas when the form is submitted to SQL.

 

I don't mind building all of the variables into the code but I'm not sure this can be done.

 

Thanks! 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,068)