web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Error getting first letter of surname in lookup field

(0) ShareShare
ReportReport
Posted on by 12

I have a list in sharepoint that I'm populating via power automate.
I had a bit of trouble getting all the data, now I'm not managing to get a lookup type value.

1.png

This value is one of the letters of the alphabet, which however I would like to obtain dynamically from each user by taking the first letter of the surname in uppercase.

2.png

To obtain this data I thought of using as custom value this function:

 

toUpper(substring(items('Apply_to_each')?['surname'], 0, 1))

 

 

3.png

and in fact it works, because I get the letters correctly, but evidently the data type is not suitable, because it makes errors:

 

OpenApiOperationParameterTypeConversionFailed. The 'inputs.parameters' of workflow operation 'Create_item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/AZLookUp/Id' is required to be of type 'Integer/int64'. The runtime value '"P"' to be converted doesn't have the expected format 'Integer/int64'.
 

4.png

What am I doing wrong? How can I solve it?

I have the same question (0)
  • Chriddle Profile Picture
    8,319 Super User 2025 Season 2 on at
    Re: Error getting first letter of surname in lookup field

    Since this is a lookup you need to insert the ID of the according item from the "Alphabet" list.

    So you have to determine this ID first.

     

  • lcristo-avvale Profile Picture
    12 on at
    Re: Error getting first letter of surname in lookup field

    The "Alphabet" list does not have an id column.

    5.png
    Should I add it? But then how do I get that ID?

  • Chriddle Profile Picture
    8,319 Super User 2025 Season 2 on at
    Re: Error getting first letter of surname in lookup field

    Every list item has an ID. It's just hidden.

    For example, you can perform a Power Automate “Get Items” and inspect the resulting JSON.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard