cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RameshMukka
Continued Contributor
Continued Contributor

Replace special characters of list name to make it compatible to use in Send HTTP Request to SharePoint action

Hello everyone,

I have a list whose name is "SOX - PO without PR (YPONR) Tasks". I am trying to create a task within this list using Send an HTTP Request to SharePoint action as I have few hyperlinks to populate. I am confused how to specify the name of the list in the body of the action

 __metadata": { "type": "ListNameListItem" } 

I know spaces can be replaced with _x0020_ but not sure of special characters like "-" (hyphen), "(" and ")". How do I encode these here and what should they be replaced with? I couldn't find any documentation regarding this. We don't want to change the list name.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Paulie78
Super User III
Super User III

Paulie78
Super User III
Super User III
9 REPLIES 9
Paulie78
Super User III
Super User III

Paulie78
Super User III
Super User III
RameshMukka
Continued Contributor
Continued Contributor

@Paulie78 

You did a great job in both the posts. I bookmarked them for future use. I was waiting such content since long time. Your form generated me blow json but it fails somehow. I tested with simple list called "TestList" and it works fine. Here is the screenshots

 

 

{
	"__metadata": {
		"type": "SP.Data.SOX_x0020_-_x0020_PO_x0020_without_x0020_PR_x0020__x0028_YPONR_x0029__x0020_TasksListItem"
	},
	"RelatedItems": {
		"Description": "Microsoft",
		"Url": "https://www.microsoft.com"
	}
}

 

RameshMukka_0-1624515374103.png

Paulie78
Super User III
Super User III

Please go to the list in your browser and copy and paste the URL here. Then we can figure out what the list name should be.

RameshMukka
Continued Contributor
Continued Contributor

Here is it 

 

/sites/rameshtest/Lists/SOX%20%20PO%20without%20PR%20YPONR%20Tasks/AllItems.aspx

 

RameshMukka
Continued Contributor
Continued Contributor

Hey @Paulie78 

I just figured it out. I replaced all %20 with _x0020_ and it worked. You blog posts came to great rescue. Thank you so much.

I think the list name would be:

SOX_x0020__x0020_PO_x0020_without_x0020_PR_x0020_YPONR_x0020_Tasks

Well done @RameshMukka 

Expiscornovus
Super User II
Super User II

Hi @RameshMukka,

 

Hope you guys don't mind that I bud in.

 

You can also retrieve the correct value for the type field by retrieving the ListItemEntityTypeFullName value via an additional HTTP request action. Saves you a bit of manual encoding time 😉

 

Below is an example of such an approach.

 

1. First collect the ListItemEntityTypeFullName value of your SharePoint List. Replace/set the ListName variable by the name of your current list name.

getlistentitytypefullname.png

2. Use the following Body to create a new item. You can use an expression to get to retrieve the correct entitytypefullname.

 

 

 

{
	"__metadata": {
    "type": "@{outputs('Send_an_HTTP_request_to_SharePoint')?['body/ListItemEntityTypeFullName']}"
  },
  "Title": "Testing Promoted Links",
  "LinkLocation": {
        "Description": "Microsoft",
        "Url": "https://www.microsoft.com"
      }
}

 

 

 

 createpromotedlink.png

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,474)