Hi guys,
I hope you might be able to take the time to answer a question for a newbie. I've gotten to grips with a lot of Automate including building some expressions. What I'm trying to do as a QOL measure right now is automating assignment of a label depending on user selection of one of three options in one question of a MS Form. In other words, I have three colours. If option 1 is selected on the form, I want colour A to be assigned to the task at creation. Option 2, colour B, etc. But I'm really at a loss at how to make that work.
A screenshot of the overall Flow is attached, if that's of any help. Thanks for any assistance!
Solved! Go to Solution.
Hi @Nubbins ,
I have made a simple test for your reference.
Here is my Flow.
if(equals(Dynamic Content,'Option 1'),true,false)
if(equals(Dynamic Content,'Option 2'),true,false)
if(equals(Dynamic Content,'Option 3'),true,false)
Result Screenshot:
Best Regards,
Charlie Choi
Hi @Nubbins ,
I have made a simple test for your reference.
Here is my Flow.
if(equals(Dynamic Content,'Option 1'),true,false)
if(equals(Dynamic Content,'Option 2'),true,false)
if(equals(Dynamic Content,'Option 3'),true,false)
Result Screenshot:
Best Regards,
Charlie Choi
EDIT: No sooner had I posted the below than I managed to work out how to modify your expression to check to see if an input contains a relevant string. so...
if(contains(outputs(Dynamic Content,'string to be searched for'),true,false)
Does the job. Thanks again for your help!
Wow @v-yujincui-msft , thanks so much for that! I'd gotten most of the way to cobbliong something together with variables and a switch, but I think your option looks a lot cleaner and works better.
In case we also want to do something similar but allowing for multiple responses to a question to be selected (which I think would then generate an array), would it be possible to adapt your expression to that kind of case? I noticed there's a contains function in Exrpessions, I just don't know how I would make that work with potentially an array while also still getting it to spit out true or false to the task.
Thanks again so much for your help!
Found this thread very useful. I am curious, does this solution allow folks to apply multiple labels on any task? Let's say I have various questions with multiple answers and those answers correspond with a label, would this populate multiple labels depending on the answer given in the form?
User | Count |
---|---|
93 | |
45 | |
20 | |
20 | |
15 |
User | Count |
---|---|
134 | |
53 | |
44 | |
36 | |
26 |