cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DarkStaarX
New Member

If value contain similar value, then start to count. and update column.

Hi there,

I am try to build a flow to identify total count based on value stated at 2 or more columns.

Example: 
Column A = Reff #
Column B = Phone # 

I want the flow to calculate if Reff# + Phone # entered first time = 1 and if same info of Reff# + Phone # entered second time, the column will update as "2" and the count will continue as long as both criteria met.

This is a live list meaning user can immediately see the count once they submit new entry.

I do not required the column to be running index but any workflow that somehow benefit the same would be greatly appreciated.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @DarkStaarX ,

 

Based on the error details you provide, it seems that you are using a wrong internal column name.

You could find the way in @WillPage 's reply.

 

vyujincuimsft_0-1651479267407.png

 

@WillPage was careful to give detailed solutions, so I don't want to plagiarize the answer, I just see that you seem be stuck.

 

In addition, you could click on the list settings to get the internal column names.

vyujincuimsft_2-1651479784842.pngvyujincuimsft_3-1651479815030.png

vyujincuimsft_4-1651479917691.png

vyujincuimsft_5-1651480218396.png

 

 

Best Regards,

Charlie Choi

View solution in original post

5 REPLIES 5
WillPage
Solution Sage
Solution Sage

The flow is triggered when an new row is added to the table? Depending on the data source you can use an OData filter query to get the relevant rows (if any) from the table.

 

I'll assume it's SharePoint but you can also do Odata filter on SQL amongst others.

So, go Get items and select your site and list. In the Odata filter query box go Column_x0020_A eq 'triggerBody()?['Column_x0020_A']' and Column_x0020_B eq 'triggerBody()?['Column_x0020_B']'

N.B Don't type it like this. triggerBody()?['Column_x0020_A'] and triggerBody()?['Column_x0020_B'] should be put in the expression editor or just drop the dynamic content from the trigger between a set of single quotes (if it's a string column). Spaces in your column name will be _x0020_ for SP and SQL data sources but other special characters will be subbed out with their own codes. You can see the internal column name by examining the dynamic content from the trigger with a mouse-over after you drop it into the filter query or in a Compose.

 

If you get your filter query working properly that action will only return rows where those two columns match exactly. You can then count them with the expression length(body('Get_items')?['value']) in a Compose, which may be 1 if there are no matches (your same row that triggered the flow will be 1). You can then sub(length(body('Get_items')?['value']),1) to take that number away from the total

Thanks Will! Glad that this is doable!

I am not good with expression and kind of stuck here but yes, you are right, this is SharePoint list. What I got here:

'CustPhone_x0023_' eq 'triggerBody()?['CustPhone_x0023_']' and ['body/Title'] eq 'triggerBody()?['body/Title']'

But the expression was invalid and I am not sure what to correct. Can help please?




WillPage
Solution Sage
Solution Sage

Don't put the column names in single quotes, only the dynamic content from the trigger. It should look similar to this:

WillPage_0-1651201101328.png

 

Error.png

 

This is what I got..... Seems like I am lost and need your help like a baby needing help to walk...

v-yujincui-msft
Community Support
Community Support

Hi @DarkStaarX ,

 

Based on the error details you provide, it seems that you are using a wrong internal column name.

You could find the way in @WillPage 's reply.

 

vyujincuimsft_0-1651479267407.png

 

@WillPage was careful to give detailed solutions, so I don't want to plagiarize the answer, I just see that you seem be stuck.

 

In addition, you could click on the list settings to get the internal column names.

vyujincuimsft_2-1651479784842.pngvyujincuimsft_3-1651479815030.png

vyujincuimsft_4-1651479917691.png

vyujincuimsft_5-1651480218396.png

 

 

Best Regards,

Charlie Choi

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!

Top Solution Authors
Top Kudoed Authors
Users online (1,953)