Get current user info from SQL DB - No code - InfoPath Dev
in

InfoPath Dev

Get current user info from SQL DB - No code

Last post 01-24-2011 10:44 AM by Hilary Stoupa. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-23-2011 12:05 PM

    Get current user info from SQL DB - No code

     Hey guys, I am new to the forums and I hope you can help me out.

    I am trying to pre-populate fields with current user information from an SQL DB but having some issues. I can pull the info from my udx connection, but I am not exactly sure how to filter the data to show only the current user information. I know about the SharePoint user profile way, which I wish I could use. However, according to our SharePoint Admin I am not allowed to use this. username() works in Infopath however. 

     Has anyone else done this before?

    Thank you in advance for you help.

  • 01-24-2011 10:05 AM In reply to

    Re: Get current user info from SQL DB - No code

    Just to add. No matter what filters I add it is pulling all the data from that specific SQL column. If I modify the data connection

    SELECT  USER_ID, EMPLOYEE_FIRST_NAME,

    FROM MYTABLE

    WHERE USER_ID = 'The user name'

     It will pull my single user id.. however, I need the current user id and not a pre-set one.

  • 01-24-2011 10:44 AM In reply to

    Re: Get current user info from SQL DB - No code

    Hi:

    The standard SQL connection in IP will pull all the data from the table. There is no way without code to add a dynamic where clause.

    If having all the data returned to your form and then filtering at that point isn't a dealbreaker, you can do that -- run your query and set your values from the returned data, adding a filter where USER_ID is equal to the current username.

    If returning all the data to your form is a dealbreaker, you can build or buy a webservice that will return just the data you need, or write some custom code to do the same thing.

    Hope that helps!

    Hilary Stoupa

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.