I have multiple set of tasks lists per user and i need to have a sequence # depends on the number of tasks.
For ex. below 4 tasks for an assigned user, so i need to stamp S.No. from 1 to 4. Other users may have 1 or 5 or 10, so accordingly I have to set the number of tasks.
[
{
"S.No.": "1",
"Task Id": "inZRueq85kixDu3zTH1zOGQAERb5",
"Aging": "0 Day(s)"
},
{
"S.No.": "2",
"Task Id": "V_j6S9Cxl0uoyT40Uy6HkmQAFbXJ",
"Aging": "0 Day(s)"
},
{
"S.No.": "3",
"Task Id": "oYDcuvc-Nkmn1MCwkaA1oGQADcdV",
"Aging": "0 Day(s)"
},
{
"S.No.": "4",
"Task Id": "A6ZGZNSFik699cFsdh9r-mQAGtAM",
"Aging": "0 Day(s)"
}
]
Solved! Go to Solution.
Something like this should do what you want:
Output generated is:
[
{
"S.No": 1,
"Task Id": "inZRueq85kixDu3zTH1zOGQAERb5",
"Aging": "0 Day(s)"
},
{
"S.No": 2,
"Task Id": "V_j6S9Cxl0uoyT40Uy6HkmQAFbXJ",
"Aging": "0 Day(s)"
},
{
"S.No": 3,
"Task Id": "oYDcuvc-Nkmn1MCwkaA1oGQADcdV",
"Aging": "0 Day(s)"
},
{
"S.No": 4,
"Task Id": "A6ZGZNSFik699cFsdh9r-mQAGtAM",
"Aging": "0 Day(s)"
}
]
Blog: tachytelic.net
YouTube: https://www.youtube.com/c/PaulieM/videos
If I answered your question, please accept it as a solution 😘
Do these need to have any particular order? Or do you just need each of them to have an S.No?
Also, is this "S.No." something that needs to increase permanently? Or simply just in the confines of each run of the flow?
If the former, then you should really setup a SharePoint list, and just put/take the data from there.
If it's the latter, I'd recommend running a simple 'Apply to each' on the array to create a new array, and have an sNoVAR integer variable increment by 1 each time, add that to a compose to make the JSON object, then append that to the new array.
I'll post pics in a second of that example, but it'll do the job for you. In terms of directly inserting it without a loop, my brain isn't switched on right now, so I might not be able to.
One pic!
Thanks for your response @eliotcole .
But i need to add the logic while filtering the data from JSON object. Output will be like below.
S.No. | Incident | Task Id | Aging | Link |
1 | INCXXXXX | TaskXXXX | 1 Day(s) | https://xxxxxx.com |
2 | INCXXXXX | TaskXXXX | 1 Day(s) | https://xxxxxx.com |
3 | INCXXXXX | TaskXXXX | 1 Day(s) | https://xxxxxx.com |
4 | INCXXXXX | TaskXXXX | 1 Day(s) | https://xxxxxx.com |
I have a select step below which i need to add a logic for S.No. (Serial No.).
Cheers, @yupabs, what does the input(s) look like, though?
(would be great to see your whole flow, if you can, please)
Hi @eliotcole ,
Below is the flow.
1. List the tasks
2. filter array (where completed date is null)
3. select userid column
4. set variable to get distinct value
5. Loop thru each users from step 4.
Now here in the loop, what i want is to get all tasks assign to each user and create HTML table with some details like title, created date, task id link and sequence#.
... and what does the input data look like?
Can you give us data that you have in the excel table? If you need to be sensitive, make it up, but it must represent all the columns that are sent through.
Something like this should do what you want:
Output generated is:
[
{
"S.No": 1,
"Task Id": "inZRueq85kixDu3zTH1zOGQAERb5",
"Aging": "0 Day(s)"
},
{
"S.No": 2,
"Task Id": "V_j6S9Cxl0uoyT40Uy6HkmQAFbXJ",
"Aging": "0 Day(s)"
},
{
"S.No": 3,
"Task Id": "oYDcuvc-Nkmn1MCwkaA1oGQADcdV",
"Aging": "0 Day(s)"
},
{
"S.No": 4,
"Task Id": "A6ZGZNSFik699cFsdh9r-mQAGtAM",
"Aging": "0 Day(s)"
}
]
Blog: tachytelic.net
YouTube: https://www.youtube.com/c/PaulieM/videos
If I answered your question, please accept it as a solution 😘
Hi @eliotcole
It is not adding to nothing, it is adding to a number (which starts at zero). I will explain a bit more...
The select action requires an array input. The "Range" function will produce an array of numbers. In the case of this flow the numbers will range from zero, up to the count of the array. So in this example something like:
[0,1,2,3]
Is what is passed into the "Select" action. So the reference to item() within the select will be one of those numbers. Because arrays are numbered from zero, but the original poster wants his sequence to start from 1, the add is adding 1 to item() which starts at zero, ends at 3.
The item() is also used to refer to the index of the original array, selecting the relevant record. Does that make sense?
Ahhhhhhhh. That's great, cheers, mate. I'd missed the range part in the input. 👍
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
29 | |
28 | |
27 | |
20 | |
10 |