Power Automate - How to upload image in SharePoint Image Column?
HTML-код
- Опубликовано: 30 янв 2023
- This video explains how to upload an image under a list image column data type?
HTTP Uri
_api/web/lists/getbytitle('Branch List')/items
content-type application/json;odata=verbose
accept application/json;odata=verbose
{
"__metadata": {
"type": "SP.Data.Branch_x0020_ListListItem"
},
"Title": "@{triggerOutputs()?['body/subject']}",
"Picture": "{\"type\":\"thumbnail\",\"fileName\":\"@{items('Apply_to_each')?['name']}\",\"fieldName\":\"Picture\",\"serverUrl\":\"spinhope.sharepoint.com\",\"serverRelativeUrl\":\"/siteassets/Lists/2f5798d0-d0a5-4574-a014-693797ea6989/@{items('Apply_to_each')?['name']}\"}"
}
Above Branch List is my SharePoint List
Image Column is called Picture
learn.microsoft.com/en-us/sha...
Hi, in my case there is a Sharepoint list which gets upated by a power app, and when I try and upload an image through the app, I want the site asset to be updated with the image file. So, my trigger is "Update/Modify sharepoint site" and then I am trying to "Create File" in sharepoint. In that case what would be the file content? I want to similarly store the image files' attachment in the site assets.
Hi, when I create the item it didn't create a folder named by the GUID. I tried creating it manually and it still didn't work...when trying to find the type/list name which is defined within the body - the list did not appear in the URL...is that because I am not an owner? Alternatively, my list name has a "&" in it - do you know how this should be represented in the body?
Heroic!!!
Thanks a lot for your support.
Can I please ask you a question? I used your method to copy one Dev SP-list to another Test SP-List. IS seems working fine until I use the test list in an Powerapp. The images aren't showing up in the gallery connected to that test list.
The difference that I See whet i use get HTTP to an item's image is that in the test list there is no "fieldId\":\"0968b52d-0361-42ff-a1e4-5de7a935623d\", present.
Offcourse this could also be misleading because there could be another explanation. @@abm4975
Displaying the textvalue of the image (Text(ThisItem.Foto.Small)) is not giving the reserved image attatchment like following: 'attachments%2FReserved_ImageAttachment_%25255b4%25255d_%25255bFoto%25255d%25255b36%25255d_%25255b97b6c2e3-b3da-4abf-8752-ad6b450d37c3%25255d%25255b3%25255d_%25255b101%25255d.png'
I need to see you flow to determine this.
@@abm4975 what is the best way to share?
Hi. I tried this out and it worked. But I want to do something slightly different. I want to use the Send HTTP to SharePoint to edit an existing item, rather than create a new item. My application is slightly different and I'm not triggering from an email, but most of what you have in this video I'm using - just different source for the image. I've modified it as needed and it works. It creates a new item in the list and fills in the image column properly. How can I modify the Send HTTP to SharePoint action to modify an existing item? This whole process seems like a really advanced way of doing something that I would have guessed should be really easy, so I'm following your process in detail and it is working for me, but because it's pretty advanced and you're drawing on knowledge that I don't have, I don't really know how to modify it to do what I want. Thanks so much for the video, and I would be extra grateful for a response.
Had the same question and just cracked it.
In your Headers add
{
"Content-Type": "application/json;odata=verbose",
"Accept": "application/json;odata=verbose",
"X-HTTP-Method": "MERGE",
"If-Match": "*"
}
And in your Uri add a (dynamic) id number for the list item you want to update:
_api/web/lists/getbytitle('HP Stakeholders')/items(17)
Hi
Thanks so much for the support.
I was away for few weeks. Do you still need help in this please?
Thanks
@@ANDRETHOMPSON Thanks! Instead of the ID can i use another field from the column? And did u change the method(from POST to PUT)?
Hello, first of all great video!
I tried to start from a picture into a document library (when file are created or modified, proprieties) and then "get file content" after that the http post but do not work 😞
Do you have any hint?
Hi
Apologies for my late reply as I was away for a few weeks.
I need to see the flow to determine. Could you post with a screenshot in the Power Automate community and tag me as @abm. I will have a look. Thanks.
Hey great video ,I was wondering if it's possible to extract imagen from an Excel file as well? I tried but an error message appears
Hi
I haven't tried that yet. Will let you know.
Thanks
hi, IT says A node of type 'PrimitiveValue' was read from the JSON reader when trying to read the start of an entry. A 'StartObject' node was expected.
clientRequestId: c4fa0008-c1f8-47c4-9201-a72a6d844100
serviceRequestId: 7ac918a1-8055-8000-687d-47b5de532d21 how can I fix that
Hi
Looks like you are missing some syntax in your body. Check the curly brackets and http method ect. I need to see your flow to determine what's going on. If you need further help I could offer a screenshare and look into this. Let me know.
Thanks
Hi, I can't find my SP.Data.name _api/web/lists, is there different way to find out? Thanks! Great video by the way :)
Hi
From the browser try yoursharepointsitename/_api/web/lists
Thanks
Thrank fo reply@@abm4975 ! Yes, I tried that, but I can't find this internal name for my list, neither for any other lists in my organization. That's why I asked if there is maybe another way?
When you open the list check the url. It should reveal the list internal name.