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 / Copy Sharepoint Item c...
Power Automate
Unanswered

Copy Sharepoint Item containg null Lookup FIelds

(0) ShareShare
ReportReport
Posted on by 14

When using Flow to copy a item in a Sharepoint LIst to another SHareoint List, I am running into problems handling Lookup Fields.

 

If the source Sharepoint Item has a Lookup field and its empty (null) and you try to create a new item from this source the Flow will throw an error because FLow (much like SHarepoint Designer in the past) can not hanlde setting a Lookup field to Null.

 

I would like to know if there is way using expressions that I can test the input field (from the source item) for null and then do nothing to avoid the error thrown.    I know I can instead use a text field in the target and set it to the Lookup field value and that is one solution but not the best one.

 

This is a really simple Flow that archives items from one Sharepoint List into another but there are multiple lookup fields and all of them can be empty -- actually FLow should be able to hanlde setting a lookup field to null but if I could use an IF expression that tests for null that might be a reasonable workaround

Categories:
I have the same question (0)
  • v-yuazh-msft Profile Picture
    on at

    Hi @ SPMP,

     

    I have made a test on my side and please refer to the screenshot of my flow as below:

    1.png

    Note:

    1. The sharepoint list “report” and “report1” both have a “lookup repairshop” column with type “lookup”
    2. The expression of the Condition as below:

    @empty(triggerBody()?['lookup_x0020_repairshop'])

     

    When an item is created in the “report” list, and the “lookup repairshop” column is null, the flow would run successfully as below:

    2.png

    When an item is created in the “report” list, and the “lookup repairshop” column is not null, the flow would run successfully as below:

     3.png

     

    Regards,
    Alice Zhang

  • SPMP Profile Picture
    14 on at

    Of course except I want to create an item for both conditions so this would be doable by adding another Create Item Action for the other branch and not include the Lookup column in that branch.

     

    But this does not solve the problem as we have lists that have 3, 4 or even 5 lookup columns  so with 4 lookup columns the logic complexity becomes amazingly complex with so many combinations of possibilities.   What I really need is to able to put an Expression in the Create Item lookup column that will do nothing if the input is null and use the value if it is not null -- there appears to be no way to do that.   WIth that capability I can have many lookup columns and I don't need any complex set of conditions with multiple Create Item actions.

     

    Seem pretty straightforward to me and your solution really only works realistically if there is ONLY one lookup column that could be null -- its really unacceptable if there are multiple lookup columns any one of which could be null.

  • UpTimize Profile Picture
    18 on at

    Hello

     

    Just stucked in the same issue and get it solved by passing ID=0 while the source item lookup field is null

     

    In this case, the copied  item will be created with an empty lookup value.

    I just use a condition If(empty(yoursourcelookupfield,null),0,yoursourcelookupfield)

     

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard