Hi everybody,
I've a json with a lot of objects inside an array. i've found a way to get a specific object via this function :
Hi @jdos3502
Glad that's you sorted with a solution but please could I request that you consider marking my response(s) as a solution, rather than your own acknowledgement for two reasons:
1. this forum is all about helping others, and if you don't share the answer, others will not benefit and
2. this forum is powered by free support. People like me do this as a hobby, we are not employed by Microsoft (yet 😋) but maybe one day. Kudos and Solutions add to our points score and potentially allow us to be promoted to Super Users, should we meet the necessary criteria. I believe the solution I demonstrated to you above was quite detailed and complex and ultimately gave you the flow you were looking for.
Details of the Super User scheme are here https://powerusers.microsoft.com/t5/Using-the-Community/Power-Platform-Community-Super-User-Requirements/ta-p/430976
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien
P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉
@DamoBird365 i've forgot the range 🙂
Now it's working perfectly well and take around 7sec per file.
Many thx
Hi @jdos3502
look at the repurpose array action screenshot. The expressions are in the comments.
you need to use range from 0 to length. And then the index is item().
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien
P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉
What i have to do is auto-incrementing the Index property in the Select operation
Maybe with an add() function ?
Many thanks for your help.
Hi @DamoBird365 ,
I'm confused with the select operation.
I'm trying to increment the index value but i don't know how to do this.
If you replace the 2nd apply to each with a select it will be 0 seconds. It’s far more efficient.
Give it a go when you next can.
Damien
Sorry I'm using another account as I'm not at home at this time 🙂
The attachment component accept N documents. So the user can add more than one document. That's why I have to loop on each file to do AI builder.
For the second loop, does the select method is more efficient than addproperty in a loop?
I'll check tomorrow morning for the flow history and get back to you but I can confirm than the most time is consumed in the second loop that add index on each items. The attachment loop is around 8-10sec per attachment.
Turning on concurrency? Yes I forgot it. That's can be the deal.
Thanks for your help
Hi @jdos3502
I'm afraid I don't understand what you are doing in the embedded apply to each actions. Never an efficient way to do things but I am struggling to understand what you are doing. You can turn on concurrency for both of those but if you can explain to me why, I might be able to suggest a better method. If they are attaching 1 file, why do you have to run the AI on multiple files?
You've also created variables, which are only ever needed if you are going to update them. A compose is just as good for a temporary, one off, storage space.
When you run the flow, what does the history look like? Where is the most time consumed? What action?
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien
P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉
Hi @DamoBird365
Thanks for your reply.
Do you have more details about how can i implement it with my need ?
I currently found a solution but too long for end users
Currently the user open a Power apps via a simple button in the CRM ribbon.
This power apps contain attachment control to attach PDF files.
So the user attach the PDF files and click save.
The Power automate is looping to all files to do a prediction with AI builder (scanning text) and it create a record in the CRM with text informations (Section cadastrale, address, ect...)
Inside the attachments loop :
1. i'm doing another loop to add index property on each items of the table (between 45 and 50 items).
2. I'm incrementing the index number for each items.
3. Outside the index loop, i'm doing a filter of my table to get the item where texte property equal "Section cadastrale"
4. After that i'm using a compose to get the next index by incrementing +1 the section cadastrale index.
Here's a part of the Power automate steps i'm doing :
1. Loop on each attachment, Predict with AI Builder, Get only the concerned table of 45-50 objects in order to loop on each items to create an auto incremented index :
2. Filter the created table of 45-50 objects with index to get the Section Cadastrale index. Search in the table of 45-50 objects the item that contain the section cadastrale index +1.
This process is too long and the user must wait 40 secondes to finish the attachment process (And for only 1 attachment).
Do you have another way to do this ? 20 sec per attachment can be a great deal. Or maybe by doing an asynchronous process ?
Many thanks again for your help.
Regards,
Hi @jdos3502
Did that work for you?
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien
P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉
WarrenBelz
146,537
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,908
Most Valuable Professional