cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Teflonreis
Helper I
Helper I

Using power automate to tag images uploaded into sharepoint using AI builder models

Hello everyone

 

I already have the AI builder models. And need to build a flow that tags images uploaded into sharepoint using the models.

AI builder models categorize images. The labels are ones such as "outdoor or indoor", "with cables or without cables", "empty room or not empty room" etc.

 

Flow testing shows that the models really do predict the tags. Uploaded room full of stuff and got correctly predicted as "not empty room".

Teflonreis_0-1661938046343.png

Teflonreis_1-1661938137227.png

 

Finally, I want to add an "not empty room" tag to the image on sharepoint. And find the image using the sharepoint search bar like microsoft is already doing here .

Have not found anything related to that yet. Hope you can help me at this point. 

 

Many thanks kind regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
Antrod
Microsoft
Microsoft

Hi @Teflonreis ,

 

Thanks for reaching out, very interesting scenario! It's indeed not easy to find how to update image tags in SharePoint from Power Automate. I managed to do it with a little trick:

  • Go to your SharePoint library, add manually the tag you want to include in the image tags columns, for example "Not empty room":

Antrod_0-1661945414222.png

 

  • Run a flow to get the tag value that actually identifies the tag

Antrod_1-1661945463549.png

Antrod_4-1661945862516.png

 

  • Then use this value when you need to update file properties in your flow:

Antrod_3-1661945661089.png

 

Hope that helps!

 

View solution in original post

9 REPLIES 9
Antrod
Microsoft
Microsoft

Hi @Teflonreis ,

 

Thanks for reaching out, very interesting scenario! It's indeed not easy to find how to update image tags in SharePoint from Power Automate. I managed to do it with a little trick:

  • Go to your SharePoint library, add manually the tag you want to include in the image tags columns, for example "Not empty room":

Antrod_0-1661945414222.png

 

  • Run a flow to get the tag value that actually identifies the tag

Antrod_1-1661945463549.png

Antrod_4-1661945862516.png

 

  • Then use this value when you need to update file properties in your flow:

Antrod_3-1661945661089.png

 

Hope that helps!

 

Hello @Antrod 

 

Thanks for the quick response. Very interesting approach to update file properties in flow!

In the question I am talking about a single image. In real life, I am thinking of hundreds of images and 10 tags per image. From your experience, is it feasable for me in power automate?
Want to automate the tagging process so far that when somebody adds an image, it gets tagged automatically. And I can search it using the search bar.

 

 

Antrod
Microsoft
Microsoft

It should be possible yes, Power Automate is broadly used to process batches of data.

 

But the best thing is to try it 🙂 You can use the trigger detecting that a file is created in your SharePoint folder and for each file run the AI Builder model and the update file properties.

 

Let us know if you have more questions!

Teflonreis
Helper I
Helper I

Thanks a lot. Will get back to it with help of your suggestions 😄

Hi @Antrod 

 

I have a follow up question.

In your workaround, the "image tags value" in "Update files properties" has an interesting format.

 

In my flow, I tried not adding any tags to my images manually, but with the following flow.

Teflonreis_2-1662126845155.png

The format and output of the AI builder predict action should be a simple string

Teflonreis_5-1662127179306.png

 

Teflonreis_6-1662127189913.png

 

The prediction is "no cabling and trays". Inserted it into Update files properties "Image tags" but gives me a formatting error.

 

But received the error 

"The data returned from the tagging UI was not formatted correctly\r\nclientRequestId: a6e2b693-639d-40b1-aef0-c20d13cd3769\r\nserviceRequestId: a6e2b693-639d-40b1-aef0-c20d13cd3769"
Teflonreis_0-1662126571674.png

 

Do you have any suggestions?

Thank you so much for the support.

Antrod
Microsoft
Microsoft

Hi @Teflonreis ,

 

Indeed if you try to add a string in the image tags it won't word because it's not recognized by SharePoint. You need to first create your tag manually in your SharePoint library, then create a throwaway flow just to see how SharePoint defined the value for it (See second bullet point in my previous answer) and then you get the name that you value that you will be able to use. 

 

In my case I created in SharePoint the tag "Not empty room" and SharePoint created a value called "Not empty room|a08c1622-..." this is th value you should use in your main flow to file in the image tags in the Update file properties action.

Hi @Antrod

 

If I want to scale it up for - say 1000 images - I could make the following flows?

1. flow that creates the tag manually

2. throwaway flow to get the defined value in sharepoint "funny format"

3. update items flow where I replace 

"Value""not empty room|4c289689-cce2-4fd1-b40d-dc962a685fc9"

Teflonreis_0-1662128007368.png

 

replace with

Teflonreis_1-1662128075043.png

 

Does it make sense for 100plus images?

I am inclined to give up on this image library ins sharepoint idea where each uploaded image gets tagged automatically. 

 

Thanks for your help and answers 🙂

Antrod
Microsoft
Microsoft

If you manage to create the flow that can create the tag automatically I guess that makes sense but I don't know if that's possible, you can give it a try 🙂

 

If you are struggling creating that image tag, you can try to ask the question in the "Building flow" section, some flow experts may help you Building Flows - Power Platform Community (microsoft.com)

 

Let us know how your automation journey is going, I'm curious to see your scenario up and running 🙂

Teflonreis
Helper I
Helper I

thanks Antrod

 

Will do that. 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (5,579)