MrJamsn
MrJamsn

Reputation: 11

Case insensitivity for SAP Odata call

I am trying to call the customers odata API and it basically works if there is the cases of the user names are the same in both systems. SAP odata api is case sensitive. And I have a few users which have a lower case letter in the username on SAP SF side while I have it in Upper case in my system(column default, not changeable to lower case).

GET https://api.successfactors.eu/odata/v2/User('123ABCD-E456'))?$format=json

If it was in the filter, I could use tolower, but it is not and I can't put it in the filter because the result is a powershell call looking like this:

Username in my system: 123ABCD-E456 Username in SAP:123abcd-e456

$Uri = 'https://api.successfactors.eu/odata/v2/upsert
$Method = 'POST'
$Body = @{
'__metadata'= @{
'uri' = "https://api2.successfactors.eu/odata/v2/User('123ABCD-E456')"
'type' = 'SFOData.User'
}
'username' = 'MaxMuster'
}
$Result = Invoke-RestMethod -Uri $Uri -Method $Method -Header $AuthHeader -Body ($Body | ConvertTo-Json)

Any idea to get an toupper (in line 5) to the rest call for SAP?

Upvotes: 1

Views: 394

Answers (0)

Related Questions