Skip to main content

Hi, good morning

 

I’m trying to upload a multiple images files stored on my sql database to a sharepoint site with a workflow, but it is impossible for me.

The image is saved in format <image><name></name><content></content></image>.

I think the best option would be format as XML, but there are no option in workflow settings.

The purpose of this is to free the GB that these images occupy in the database and leave them in the cloud

 

Anyone can help me?

 

Kind regards,

Isaac Labuena

Hi @IsaacL 

 

The SharePoint smartobjects for document libraries use a file property to upload documents. The same type property should be returned by a database smartobject. So in your process just read a file from a database and then upload it to sharepoint.

 


To elaborate on Ivan’s suggestion - If you generate smartObjects from a SQL table which already contains file content, the smartObject property type will be set to a memo field - This will return the text as is in the XML format you see. 
To get the SQL SmartObject to interpret the field’s XML value as file/image, you need to change the generated SQL SmartObject’s property to type File.
Once that is done, you can use the property as any other File property without needing to handle the XML data manually. 


Hello,

 

I have this configuration on smart object:

 

I have the “image” type because I use a smartphone to take the pictures and when I click on image control it opens the camera of the smartphone.

Next on Workflow I have that:

And here the screenshots step by step:

  1. SmartObject (filtered to test only one img):
  1. Add document to library (using reference and image control):
  2. Send Mail (i’m trying to show the item link):

  3. And on email doesn’t appears the link:

  4. And I can’t found on sharepoint library:

  5. Finally if I go to Reports tab I found the execution of that:

 

 

I don’t know what I’m doing wrong.

 

Thanks,

Isaac Labuena

 


Hi Isaac

As far as I can remember, List methods do not return the contents of file properties as it could result in large amounts of data, even though your filter might be reducing it to one item - And I believe this is why no records are being created in the document library. 

As a test, I would first update the document library step to load the file through a load/read method and hardcoding the ID of the record to a known ID that contains a file. (You can use inline context field loading of the file if you want as a test). 

If that works, then your workflow must be updated to either loop through the list method’s returns if you expect more than one file can exist and then use the load/read method based on the loop-item’s ID, or if you expect only one file to return based on the filter, then you can use the return id of the list method is the input of the load/read method. 


Hi ChristoffB

 

Thanks for your answer, I tried to reproduce the steps you mentioned, but the images can’t upload to sharepoint.

 

 

With these steps I can attach the image to the email, but it is not what I want:

Do you know of any other solution to achieve this?

 

Thanks,

Isaac Labuena


I was able to create a workflow with your exact scenario - The only difference was that I used the document library’s associated smartObject directly instead of the “Add document” step, but there should be no difference. 

Note in the screenshots that on the first step when executing the list method, I changed the option to only return the first item - This was just done for simplicity to test things out. 
When running the workflow, it successfully created the file in SharePoint
 

First step executing the SQL table list method

​​​​​
Second step upload document to sharepoint inputs
Add the identifier field of the reference as the input to the Read method

 


Hi @IsaacL 
Have you managed to solve your question?


Hi, 

Sorry for the delay.

I have tried all the solutions that you have told me about. But none with success, I'm starting to think it's a problem in my environment.

Kind regards,

Isaac Labuena

 


Reply