Hi all,
Can you advise if it is possible to update the values in a multiple choice sharepoint column based on the value chosen by the user in a separate single choice column?
For example, lets say the multiple choice column has 7 choices (C1, C2...C7) and the single choice column has three choices, but only one can be chosen (SC1, SC2, SC3). Can an expression be created in a flow so that if SC1 is chosen, the multiple choice column would choose C1, C2, C3, C5 and C6, if SC2 was chosen then the multiple choice column might update with C1, C2 and C7 and if SC3 was chosen then the multiple choice column has C1 and C2 chosen.
Any help is really appreciated 🙂
Solved! Go to Solution.
I was able to solve this problem myself by putting the arrays for each multichoice column scenario into compose actions then creating an if(equals(...)) expression referencing each single choice column choice, such that it referenced the correct multichoice array scenario in each situation. This expression was then placed in the multichoice column update item action.
Refer below for my expression.
if(equals(outputs('Create_item_2')?['body/SingleChoiceColumn/Value'],'SingleChoice1'),outputs('MulichoiceArrayCompose1'),
if(equals(outputs('Create_item_2')?['body/SingleChoiceColumn/Value'],'SingleChoice2'),outputs('MulichoiceArrayCompose2'),
if(equals(outputs('Create_item_2')?['body/SingleChoiceColumn/Value'],'SingleChoice3'),outputs('MulichoiceArrayCompose3'),
outputs('MulichoiceArrayCompose4'))))
Yes, that can be done. Just use a switch with the value from your single-choice field and update the multi-choice field accordingly:
Thank you @David- , i have seen a switch used and if this is the only way ill use this method, but i was wondering if there was another way to complete this without switch as it would cause my flow, which is already quite big, to get even bigger as I'd have to replicate the following steps in each of the switch conditions.
I was able to solve this problem myself by putting the arrays for each multichoice column scenario into compose actions then creating an if(equals(...)) expression referencing each single choice column choice, such that it referenced the correct multichoice array scenario in each situation. This expression was then placed in the multichoice column update item action.
Refer below for my expression.
if(equals(outputs('Create_item_2')?['body/SingleChoiceColumn/Value'],'SingleChoice1'),outputs('MulichoiceArrayCompose1'),
if(equals(outputs('Create_item_2')?['body/SingleChoiceColumn/Value'],'SingleChoice2'),outputs('MulichoiceArrayCompose2'),
if(equals(outputs('Create_item_2')?['body/SingleChoiceColumn/Value'],'SingleChoice3'),outputs('MulichoiceArrayCompose3'),
outputs('MulichoiceArrayCompose4'))))
User | Count |
---|---|
100 | |
37 | |
26 | |
23 | |
16 |
User | Count |
---|---|
132 | |
52 | |
48 | |
36 | |
24 |