cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yiwen126
Helper I
Helper I

Create Task from Excel with Label updates

Hi,

I have a Flow that creates tasks based on an Excel table.  My question is how would I be able to designate the Label to its appropriate category?  Below is the sample of my flow.

yiwen126_0-1663341477578.png

Also included is the sample task table created.  I have the Category column below to be specific Label and manually updated the text of each label needed to a different text.  

yiwen126_1-1663341538334.png

 

Any assistance is greatly appreciated.

10 REPLIES 10
Sundeep_Malik
Community Champion
Community Champion

Hey @yiwen126 

I dont think it might be the best approach but use a switch statement. Pass the category column in it and make appropriate cases. 

Maximum switch case limit is 25.

Where would I place the switch statement in my flow?

Sundeep_Malik
Community Champion
Community Champion

@yiwen126 

Inside that apply to each action.

Sundeep_Malik
Community Champion
Community Champion

@yiwen126 

Something like this: 

 

Sundeep_Malik_0-1663342480013.png

Create separate task for each case. 

yiwen126
Helper I
Helper I

Sorry, I'm still very new to this.  Do you mean after Create a task within Apply to each?  I don't see the ability to add a new step before Create a task.  And how would you write it?  Could you provide an example?

Sundeep_Malik
Community Champion
Community Champion

@yiwen126 

You cannot add anything before create task.

So you will have to delete it. 

Then use switch action.

And then for each separate case use the create task action.

yiwen126
Helper I
Helper I

That would be a lot of flow to repeat after each switch condition.  Do you have any other suggestions?

Sundeep_Malik
Community Champion
Community Champion

@yiwen126 

I know, but currently can't think of a better method. 

Make a case, then copy the create a task action and then make another case and copy it in that. Just make sure you change the color value.

Sundeep_Malik
Community Champion
Community Champion

@ScottShearer 

@Pstork1 

 

Any better approach?

The only other way to do it that I see is to initialize one variable for each category set to false.  Then use a switch statement based on the input to set one of the variables based on the category value being passed in.  Then use all the variables in the category field of the create a task.  Its pretty similar to @Sundeep_Malik 's suggestion.  But you only have to create one Create a task action.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,584)