Check Multi Value Column

  • 21 December 2016
  • 9 replies
  • 90 views

Badge +1

Hi all

i have the following Problem. I have a Document Library with a column named "Empfänger". This is a lookup column which leads to a ReferenceList. This List has the column "Empfänger Gruppe" and the column "Empfänger" which is a Person column which can store Multiple values.

The workflow in the Library needs to check which Values are entered in the column "Empfänger".

He then needs to check for each value in this field what the Empfänger are in the List.

For Example

Empfänger column Library: Group 1;Group 2

referenceList: "Empfänger Gruppe" Group 1 with (Empfänger Pascal Sparla)

        "Empfänger Gruppe" Group 2 with (Empfänger Bill Gates)

He should get Pascal and Bill which he can store in a Collection so he can send the email.

I start the Workflow with a regular expression to store the data from the column Empfänger (library) in a Collection.Then i use a For each where i use this collection and store the values in a Text Variable.

A Query List on the ReferenceList ist the next step where i set the filter on "Text Variable" = "Empfänger Gruppe" (referenceList) and store the Empfänger field of the ReferenceList in a new Collection.

When i use only one entry in the Empfänger column in the library it works fine but with multiple values it does not work.

EXAMPLE WORFLOW RESULT

MessageOutcome
21.12.2016 21:34WorkflowkommentarALLE GRUPPEN: Projektbericht; Ausführungsplanung; 
21.12.2016 21:34WorkflowkommentarGruppe: Projektbericht 
21.12.2016 21:34WorkflowkommentarCOLL-EMPF: i:0#.w|mucq11111#.w|mucq00000;i:0#.w|mucqxn1234; 
21.12.2016 21:34WorkflowkommentarGruppe: Ausführungsplanung 
21.12.2016 21:34WorkflowkommentarCOLL-EMPF:

Any ideas or examples?

Regards

Pascal


9 replies

Userlevel 5
Badge +14

try to trim() group name, it looks like you have there a space at the beginning

Userlevel 6
Badge +12

Hi Pascal,

I don't think there's any issue whether you have one person or multiple people in your groups because the results clearly show 3 people being returned when you query Projektbericht.

What happens when you just query the group Ausführungsplanung?  You can test this directly in the workflow inside the Query List action. Use the "Run Now" button and change the XML.  Hopefully the umlaut over the u doesn't affect the query action.

If there's nothing wrong with the Ausführungsplanung group query then we'll have to look inside your for each loop or when you are storing the group list in the second collection.  e.g. are you retrieving the correct list item?  Are you using the correct index?

Cheers,

Chris

Badge +1

Hi Chris

when i query only one Group it works fine. does not matter what group is selected. It is only on the second or third loop the workflow makes. It collects the correct Group but cannot find the Persons attached to the group.

it seems i cannot upload pics here so i have to do it with text

REGULAR EXPRESSION (Here i split the Empfänger column from the Library)

Pattern ;

Operation Split

Input text [ItemProperty:Empf_x00e4_nger}

Store Empfänger_COLLSTART (Collection)

FOREACH (Use the Split Results to loop through the Referenzlist)

Target Collection: Empfänger_COLLSTART 

Store Result in: EmpfängerGruppe (Single Line Text)

QUERY LIST (query the referenzlist where the column Empfänger Gruppe is equal to EmpfängerGruppe (Variable) and store the Empfänger (Persons) into a new Collection)

List Referenzliste

Filter Empfänger Gruppe is equal to EmpfängerGruppe (Variable)

Store EmpfÄnger into coll-Empfänger (Collection)

Badge +1

Hi Marian

there is a space between the : and the text so it is not in the column itself

Userlevel 5
Badge +14

Have  a closer  look at  row with  'ALLEN GRUPPEN'

Userlevel 6
Badge +12

Hi Pascal, it must be something inside that loop then.  This is my last day in the office and we're in different timezones so hopefully some of these suggestions help.  I'll take a closer look at what you've described above and try to replicate.

Also, let's make certain you are storing the group name correctly and then querying correctly.  Can you run a query action inside your loop to retrieve the group name?  I know you're filtering on group name already but let's make sure this is working so if you retrieve the group name and log it, let's see that you actually get a result.  If you do (and it doesn't have any leading/trailing spaces that Marian suggests) then you can investigate why the names aren't being retrieved.

Cheers,

Chris

Userlevel 6
Badge +12

Hi Pascal,

I've run some further investigation and Marian is right - there is a leading space.  In your regular expression you are splitting on just the semi colon (;) when in fact the "text" inside the Empfänger column is delimited by a semi colon and a space.  i.e.

Your text example also had a semi colon after Ausführungsplanung.  I'm not sure why that's there.

Here's a screen shot of an example I used when only using semi colon for the pattern in the regular expression:

You can see that there's a space in front of BMW as we iterate through the names.

Here's what happens if you change your regular expression to split on semi colon and a space [; ]

Change that and you're up and running.

Merry Christmas!

Userlevel 5
Badge +14

yes Chris, that's exactly what I've meant.

Here's what happens if you change your regular expression to split on semi colon and a space [; ]

as you have noted, in ‌'s example there is one additional semicolon at the very end of list of groups, but not in your test case.

hard to say it definitely from screenshot but I would say it's not followed by a space. in that case it will not be matched by your regex pattern and semicolon will be considered as a part of group name, which will again cause to fail on group name comparison.

one another hitch could be that it is not regular space (0x20) but rather nonbreakable one (0xA0). your pattern do not address it as well.

collection elements separator is just semicolon,

so I would stick to it in regex pattern and would perform separate trim() which deal with types of spaces.

Userlevel 6
Badge +12

Hi Pascal,

You'll have to try this yourself as your envrionment/regional settings may produce different results to the solution I provided.  In my version of Nintex the collection "string" is delimited by a semi-colon and space so the simple regex works well without having to worry about any strange characters such as nonbreakable spaces.  One thing to check for sure is exactly how your individual elements are named when you extract them.

Log their names and put some text infront and behind them like I did with my square brackets [ ] so you can see if there are any leading or trailing spaces.  Also double check that it extracts the first element and the last element of your colleciton properly - I'm not sure why you have that final semi-colon but this could be an environment-specific thing.

Cheers,

Chris

Reply