Hello everyone,
My SharePoint list follow this structure:
Type | Name |
AAA | Example |
AAA | Example |
BBB | Example |
BBB | Example |
CCC | Example |
BBB | Example |
I'm trying to create a Flow that does the AUTO INCREMENT function for a given column in my SharePoint list.
In my SharePoint list, I have the Type column, which can only have 3 types of values (AAA, BBB and CCC).
So whenever the user responds to a new Forms, the flow must first see what the Type is in the response sent and, according to the type, go to the list and capture the last value in the Increment column of this Type. With that information, the flow finally add the new item with the answer coming from Forms. For this newly inserted item, the Increment value must be the value of the last Increment of this type +1. The expected result should be something like the table below:
Type | Name | Increment |
AAA | Example | 1 |
AAA | Example | 2 |
BBB | Example | 1 |
BBB | Example | 2 |
CCC | Example | 1 |
BBB | Example | 3 |
Can anyone help me?
Solved! Go to Solution.
Hi!
Once you get a new forms response, you need to identify its type (AAA, BBB or CCC)
Now, I would add a SP 'Get items' action block to read all items from your SP list.
Next, I would add a 'Filter Array' action block, assign as its input 'Get items Value' output. On Filter Array, I would add a condition to get all items whose type matches with current Forms Response.
Then, I would add a SP 'Create item' to store response related values as a new item on the SP list. Please note in order to assign the proper value to Increment column, you can use the following WDL expression:
add(length(body('Filter_array')),1)
THe point is, length(body('Filter_array')) provides the nr of items in your SP list filtered, i.e. the nr of elements matching your current response type. So you just need to add 1
Hope his makes sense.
Proud to be a Flownaut!
Hi!
Once you get a new forms response, you need to identify its type (AAA, BBB or CCC)
Now, I would add a SP 'Get items' action block to read all items from your SP list.
Next, I would add a 'Filter Array' action block, assign as its input 'Get items Value' output. On Filter Array, I would add a condition to get all items whose type matches with current Forms Response.
Then, I would add a SP 'Create item' to store response related values as a new item on the SP list. Please note in order to assign the proper value to Increment column, you can use the following WDL expression:
add(length(body('Filter_array')),1)
THe point is, length(body('Filter_array')) provides the nr of items in your SP list filtered, i.e. the nr of elements matching your current response type. So you just need to add 1
Hope his makes sense.
Proud to be a Flownaut!
This is perfect. Thank you very much 🙂
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Did you know that you could restore a deleted flow? Check out this helpful article.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
31 | |
30 | |
24 | |
24 | |
21 |
User | Count |
---|---|
64 | |
57 | |
43 | |
37 | |
29 |