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

Flow that auto populate column based on other columns values

Hi, I have a two columns, each of them is a type of multiple choice. I want to build a flow, that will auto populate 3rd column based on the chosen combination in two other columns.

So far I constructed this:

cnapan_0-1643789467594.png

The compose expression is like that:

if(and(contains('Location''Tokio'),contains('Asset_x0020_type''Laptop')),'TOKIO-L-',if(and(contains('Location''Miami'),contains('Asset_x0020_type''Desktop')),'MIAMI-D',''))
 
The update item step has just Output of expression in desired column.
The flow though does not work. I think I miss some step in the schema. Can anybody help me?
1 REPLY 1
tom_riha
Super User
Super User

Hello @cnapan ,

as you have it now you're comparing two strings, but I think you want to compare values in columns. Therefore, you should use dynamic content in the expression. The expression should look similar to the example below:

if(and(contains(triggerOutputs()?['body/Location'], 'Tokio'),contains(triggerOutputs()?['body/Asset_x0020_type'], 'Laptop')),'TOKIO-L-',if(and(contains(triggerOutputs()?['body/Location'], 'Miami'),contains(triggerOutputs()?['body/Asset_x0020_type'], 'Desktop')),'MIAMI-D',''))

Note: it's just a guess from my side, you should use dynamic content when building the expression to get the right values.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,013)