Remove ID (characters) after Username

  • 20 September 2018
  • 8 replies
  • 6 views

Badge +11

Hello

I have a workflow which updates a Group or People field with 2 usernames.
The purpose is to show them in such a format:  Tom Jones; Alice Smith 

However, when extracting the list from to Excel then I see the following: Tome Jones;#57;#Alice Smith;#116

How can I make those characters disappear?
When looking at the list then the names are appearing correct without the ID's.

In the workflow I have a Build String as following:

The variable LogPurchManager is set to Text / Single Line.
I am not sure if that needs to be People or Group instead ??

I also got an Update Item function to update the Managers field:

Just wondering how would I remove those # ID's.


8 replies

Userlevel 5
Badge +14

that's simply the way how sharepoint internally stored users in people&group field.

there is no way how you could get just user display names out of it.

if you need just display names stored them in simple text field.

Badge +11

Hmmm I then I am confused to why it works for one People or Group field but not for another!


I have another PoG field called Requester, which is updated with the Current User < and surprisingly the field does show the user's name as normal without any ;#ID afterwards. See the list settings:

Now this is in excel:

So, why does Requester not show the strange characters?

Yes, I have also data in Managers field where is one user and there is the ID's as well.

by the way, the LogPurchManager is set as text / single line.

Userlevel 5
Badge +14

that's sharepoint's behaviour....

if you enable multiple entries on person or group list field, sharepoint always outputs them with user IDs (even if the list field is populated with a single entry). if you do not enable multiple entries, then it outputs just display names.

I'm not sure what's the reason for the difference.

Badge +11

I usually create variables in Text/SingleLine for usernames to be stored in... and was blaming that.
Now I am in middle created new variables for users as PoG in hope this may fix it but I doubt so sad.png

Userlevel 5
Badge +14

well, it's not black or white, one or the other.

working with user (entity) is not always so easy and straightforward.

one always have to consider each specific use case. and functionality and limitations of both sharepoint and nintex.

in this your specific case I'd kept user data in a person or group field and tried to clear user data after the export. you could eg. write a small macro that could do the job.

or you can built your own workflow that would do the export. within the workflow you would have full control over what's exactly exported and in which format.

Nintex Workflow - List to CSV UDA - Vadim Tabakman 

Badge +11

Hi Maria

Thanks for your input.

Indeed, I have now created new variables for the Users and set it to People or Group field.
The only variable LogPurchManager is set to Text/Single Line instead of PoG ...

That variable is used in a Build String where I said concatenate two user names divide by ;
Not sure if that needs to be PoG as well?

Either way, as you said, all this has no impact and will not remove the ID's.
Indeed, when the Allow Multi-User is enabled that is where it inserts the ID number automatically.

As per the MACRO, sounds good idea BUT does it mean that the macro needs to be created for each list which is exported? From my understanding, every time you export it, it is there as temp and the data will not sync?

Userlevel 5
Badge +14

Not sure if that needs to be PoG as well?

workflow variable of type Person or Groups can store just single user account. so string variable is correct for this case.

 does it mean that the macro needs to be created for each list which is exported

no, it would single macro.

you just need to distribute it to all the users which will do exports, so that they can run it on their own after ach export.

Badge +11

Ahhh, yes.
I was able to save the excel sheet to my desktop and then with the refresh button, it pulls down the latest info happy.png
Indeed, building a macro within the same file and then distributing it to the users is a good idea.

Now is time to dig some VBA coding for the macro lol

Cheers

Reply