cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Append the column names that has "Yes" value (Yes or No Field)

Hello guys,

 

let's say I have three "Yes or No Field" columns (AA, BB, and CC). I want to populate the columns with the value Yes into the word document.

columns.PNG

 

How can I make a flow that combines the name of the three column into one string? so when I update the document I can add it there :).

 

That's how I want it to look like:-

 

populate.PNG

 

For example, I want to get AA and CC to be inside the document because they have "Yes" value, and BB will not be populated because it has a "No" value

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Append the column names that has "Yes" value (Yes or No Field)

@Malamri hopefully this will give you a walk-through of one way to do it.

I created a SharePoint list the same as yours:

0-list.png

Our overall flow will look like this with a parallel branch for each meeting:

0-overallFlow.png

As each of the parallel branches are the same we won't look at each one but just at the Operations branch.

I've set a manual trigger for the flow then added string variables for each of the meetings:

0-trigger-initVariables.png

The rest of the actions are shown below and we'll look at each one:

1-otherActions.png

So the next action is to add a SharePoint Get items action. Add a filter query so that you only get the item that you want, in this case it's Title eq 'Monthly Operations Meeting'

2-getItems.png

You then need to add an apply to each even though only 1 item is returned. Then add a Compose where the inputs for this first one is the CSSO column from the dynamic content.

Add a Condition where Outputs (of the Compose above) is equal to true.

Leave the red If no channel empty. In the green If yes channel add an Append to string variable, select varOperations which you created earlier and in the Value box type CSSO then add a space:

3-applytoEach.png

You then need to do the same action from apply to each onwards for the COO and CFO.

So you've now got 3 apply to each controls under the Get items. The final action is to add another Compose and select varOperations from the dynamic content:

4-resultCompose.png

When you run the flow it will put into the varOperations variable those attendees where the column value for that meeting is Yes. And the result of the Compose looks like this and you can then use the output in a following Word action:

5-resultAttendees.png

The other branches have run in parallel and have the relevant meeting attendees in the appropriate variable:

5a-otherMeetings.png

 

 

Hope that helps but come back with any questions.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

3 REPLIES 3
Highlighted
Dual Super User
Dual Super User

Re: Append the column names that has "Yes" value (Yes or No Field)

Create a string variable and then do three conditions in a row where you test the columns for true.  If the column is true then append the name of the column and a space to the end of the variable.  After all three conditions are done the variable will contain a string of the column names that were set to true.



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

Re: Append the column names that has "Yes" value (Yes or No Field)

Hi @Pstork1,

 

I appreciate your reply. I was struggling doing what you mentioned so I decided to make this post hopefully someone can guide me through the process. Still unable to achieve it.

However, what I did is creating a table in the word document with the column names. Then I update it with the values (True, False).

 

It's not a perfect solution, but at least it's so close from my needs.

Highlighted
Super User
Super User

Re: Append the column names that has "Yes" value (Yes or No Field)

@Malamri hopefully this will give you a walk-through of one way to do it.

I created a SharePoint list the same as yours:

0-list.png

Our overall flow will look like this with a parallel branch for each meeting:

0-overallFlow.png

As each of the parallel branches are the same we won't look at each one but just at the Operations branch.

I've set a manual trigger for the flow then added string variables for each of the meetings:

0-trigger-initVariables.png

The rest of the actions are shown below and we'll look at each one:

1-otherActions.png

So the next action is to add a SharePoint Get items action. Add a filter query so that you only get the item that you want, in this case it's Title eq 'Monthly Operations Meeting'

2-getItems.png

You then need to add an apply to each even though only 1 item is returned. Then add a Compose where the inputs for this first one is the CSSO column from the dynamic content.

Add a Condition where Outputs (of the Compose above) is equal to true.

Leave the red If no channel empty. In the green If yes channel add an Append to string variable, select varOperations which you created earlier and in the Value box type CSSO then add a space:

3-applytoEach.png

You then need to do the same action from apply to each onwards for the COO and CFO.

So you've now got 3 apply to each controls under the Get items. The final action is to add another Compose and select varOperations from the dynamic content:

4-resultCompose.png

When you run the flow it will put into the varOperations variable those attendees where the column value for that meeting is Yes. And the result of the Compose looks like this and you can then use the output in a following Word action:

5-resultAttendees.png

The other branches have run in parallel and have the relevant meeting attendees in the appropriate variable:

5a-otherMeetings.png

 

 

Hope that helps but come back with any questions.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (5,729)