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
Super User

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

Take a look at this blog post I did yesterday:

How to Encode SharePoint Column Display Names to Internal names 

Paulie78
Super User
Super User

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
Super User

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
Dual Super User
Dual Super User

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 Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,726)