cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

Hi,

Does any one know how can i read Multi-Choice Field in NW O365. I am reading the current item and need to iterate over values to find some specific choices. Am using Multi-Select Checkbox field.

Thanks,

Nutan

Labels: (1)
0 Kudos
Reply
9 Replies
Not applicable

Re: Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

To add more, i went with typical set of actions using dictionary.

1. set dictionary variable with choice field value

2. count the items in dictionary

3. log the count

4. use Loop N Times and get the item from dictionary

But it fails on the first step itself saying casting from collection to string is invalid. Though my variable is a dictionary type. I also tried with string variable but that doesn't work either. same error in both the conditions

Workflow suspends and displays below.

RequestorId: 7b9c831a-f99a-af34-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.InvalidCastException: The value 'd/results(0)/Request_x0020_Type' cannot be read as type 'String'. at Microsoft.Activities.GetDynamicValueProperty`1.CheckedRead(String propertyName, DynamicItem value) at Microsoft.Activities.GetDynamicValueProperty`1.Execute(CodeActivityContext context) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) Exception from activity GetDynamicValueProperty<String> Sequence DynamicActivity<String> ParseDynamicValue Set Workflow Variable Sequence Flowchart Pre-Sales Support Request.WorkflowXaml_41133bb3_ae2b_4080_8b56_ceec68f42bd6

0 Kudos
Reply
Automation Master
Automation Master

Re: Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

Dictionaries can have dictionaries in them. I wonder if that has happened because this is mutli select choice field.

instead of the loop, can you just but the variable in a Log History action. Then print the results here?

0 Kudos
Reply
Not applicable

Re: Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

Hi Andrew,

I tried to print the dictionary. But again it does not get printed if you read directly from current item. Same error as above.

I overcame this problem by using Query List Action and retrieving the same item from the list by ID. And then use the conditions which i wanted to use.

I guess that's the ideal way with which Dictionary Works. Though i still wanted to know how can iterate over Current Item Dictionary Field.

Thanks,

Nutan

0 Kudos
Reply
Automation Master
Automation Master

Re: Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

Glad to hear you have a solution. Though I don't understand the connection. Was the multi-choice value somehow related to the list item you queried to get the ID? Thanks, I just want to put it all together to see how you came to that result to learn from your situation.

0 Kudos
Reply
Not applicable

Re: Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

Hi Andrew,

Yes, the scenario is something like this,

I have a list with multi-choice field. I need to do some XYZ operations based on what values a user picks up for the item in that multi-choice field.

So if he picks up A & B, do some XYZ stuff. When i tried to read the field values in WF associated to the list, it dint let me read the values from that field and threw the expections i mentioned earlier. Neither is a Dictionary Variable nor to write in a log.

Then i used Query List Action to filter the current context item by ID from the same list.

Hope you got the exact scenario now

Thanks,

Nutan

0 Kudos
Reply
Automation Master
Automation Master

Re: Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

Wow, I haven't run into a scenario with the {item property:multichoicefield} gave an error in Log to History, but doing a Query List Action to get the same value worked just fine. When I  do, I'll remember your post as a good option. It just sounds bizarre you had that issue.

I would go ahead an mark your answer as correct as your resolution for others to find if they also run into this.

0 Kudos
Reply
Not applicable

Re: Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

Thanks Andrew, please post the updates  whenever you try this. I will be glad if it works.

You can mark my answer correct. I don't mind at all

Thanks,

Nutan

0 Kudos
Reply
Automation Master
Automation Master

Re: Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

Thanks, you can go ahead and do so by clicking the mark correct button under one of the posts.

0 Kudos
Reply
mikeboggs
Nintex Newbie

Re: Read Multi-Choice (Checkbox) Field in NW O365

Jump to solution

I posted what I believe to be a solution to this in another thread. I'm updating this one for people who find this thread searching for this issue.

How can you create collection to loop through based on values from a multi-select checkbox field?

0 Kudos
Reply