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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating a lookup colu...
Power Automate
Answered

Creating a lookup column in a list

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

i am trying to create a lookup column for a new list i am creating using the http request. I believe i've got most of it setup but im not sure on the json need to all for multiple fields in this case ID and essionDuration.

 

This is the column i'm trying to replace in flow:

arturdjali_0-1655467654689.png

 

this is how it looks in the flow:

arturdjali_1-1655467757049.png

 

any help is appreciated.

 

thank you 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Anonymous,

     

    You could use the CreateFieldAsXml method for the creation of a lookup field. 

     

    Try something like below:

     

    {"parameters":{"__metadata":{"type":"SP.XmlSchemaFieldCreationInformation"},"SchemaXml":"<Field DisplayName='Course' Format='Dropdown' Indexed='FALSE' IsModern='TRUE' IsRelationship='FALSE' List='@{variables('LookupListGUID')}' Name='Course' ShowField='Title' Title='Course' Type='Lookup'></Field>","Options":12}}

     

    createlookupfield.PNG

  • Community Power Platform Member Profile Picture
    on at

    Hi @Expiscornovus ,

     

    This works perfectly for creating the lookup column, my only other question what change would i need to make to select columns to show ID and SessionDuration?

     

    arturdjali_0-1655720667052.png

    Thank you

  • Verified answer
    Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Anonymous,

     

    You can use the FieldRef property in two other requests with the same CreateFieldAs Xml method. You can reuse the Id from the output of your first request to reference the lookup field in your second and third request.

     

    Below is an example.

    {"parameters":{"__metadata":{"type":"SP.XmlSchemaFieldCreationInformation"},"SchemaXml":"<Field DisplayName='Course: ID' FieldRef='@{body('Send_an_HTTP_request_to_SharePoint')['d']['Id']}' Format='Dropdown' IsModern='TRUE' List='@{variables('LookupListGUID')}' Name='Course: ID' ShowField='ID' Title='Course: ID' Type='Lookup'></Field>"}}

     

    createfieldasxml_relatedcolumns.png

     

  • Community Power Platform Member Profile Picture
    on at

    @Expiscornovus  Thank you! That does the trick.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard