Find a post...

DNN-Connect Blogs

Get profile properties in DNN

This SQL function will help you retrieving property values from the users.

You can even ask for custom created properties.

you can use it in your reports like this:

select userid,username

,dbo.BIT_GetPropertyValue(0,userid,'Phone') as 'Phone'

,dbo.BIT_GetPropertyValue(0,userid,'Mobile') as 'Mobile'

from users

 

 

CREATE FUNCTION [dbo].[BIT_GetPropertyValue]
(
@PortalID int, -- portalid
@UserID int, -- UserID
@Property nvarchar(100) -- name of the property to read
)
RETURNS nVarChar(4000) -- the value of the property for the user
AS
BEGIN
DECLARE @RetVal AS nVarChar(4000) = ''
select @RetVal = PropertyValue
from UserProfile
where UserID = @UserID
and PropertyDefinitionID = dbo.GetProfilePropertyDefinitionID (@PortalID,@Property)

RETURN @RetVal
END 

 

Passionate DNN.NET specialist helping customers with the automation of their organisation. Having a large technical SAP background, I connect DNN to SAP seamlessly. I'm an expert not only in connecting SAP but all kinds of different systems. It does not even need to be a known product, ff it's possible to extract data, I'll do it. DNN is the base of all my projects as it contains already the stuff you will need anyway: users, roles, pages, .. and of course the fantastic way you can develop modules for it. I especially like the install with the versioning system of the modules. It helps me so I can totally focus on the business problem of my clients. I've been making modules for DNN since my first .NET application with the I Buy Spy release.

Hosting liberally provided by

Philipp Becker 6012 7
Geoff Barlow 547 4
DNN-Connect 431 6
Peter Donker 5060 30
Christopher Hammond 681 2
Olivier Jooris 419 1
Daniel Mettler 12009 88
Clint Patterson 1 1
Jos Richters 65 1
James Rosewell 327 2
Will Strohl 1546 27
Ernst Peter Tamminga 437 4
Barry Waluszko 2807 2
Declan Ward 453 1
Gifford Watkins 722 9
Torsten Weggen 2697 3