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 Apps - Microsoft Dataverse
Answered

Cannot set default lookup value on a CDS field

(1) ShareShare
ReportReport
Posted on by 309

I have a CDS data source (dynamics 365) powering an Edit form.  The edit form is set to "new" form so a user can fill-in the form.  I have some lookup fields and that needs to be set to a default value.  Normally, I simply type the value text like "UPS" or "FEDEX" and it works fine.  But using CDS as the source, PowerApps keeps return error. I search everywhere, but can only find sharepoint example with ODATA.

 

I tried to type the actually GUID "1f865925-843c-e911-a971-000d3a34a14b" of lookup time and even type the text value "UPS" , no luck 😞  

 

I'd appreciate if anyone could share how they were able to setup default values coming from CDS.  Thanks.,

 

GUID.pngDefault Text based value.png

 

I have the same question (0)
  • CU22081450-0 Profile Picture
    Most Valuable Professional on at
    Re: Cannot set default lookup value on a CDS field

    Hi @testasdfasfsafa ,

     

    This property needs to insert the Record value. We can use this sample below:

     

    Default --> First(Filter(YourCARRIEREntity, "new_name" = "UFS"))

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Renato Romão
    https://www.linkedin.com/in/renatoromao/

  • testasdfasfsafa Profile Picture
    309 on at
    Re: Cannot set default lookup value on a CDS field

    Thank you so much for the expert advice!!  Your suggestion seems to make perfect sense.  There is no error anymore :), but the default value doesn't show up when I run the app...  Any thoughts?

     

    New formula.png

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at
    Re: Cannot set default lookup value on a CDS field

    Are there any options when you open the Carrier dropdown?

    If yes, can you check if it has the "UPS" value?

    If yes, can you check if it shows the "new_name" column?

    If yes, try to change the code to First(Choices(@[...].new_Carrier)) instead of First(Filter(...))

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Renato Romão
    https://www.linkedin.com/in/renatoromao/

  • testasdfasfsafa Profile Picture
    309 on at
    Re: Cannot set default lookup value on a CDS field

    First of all, let me express my gratitude for your guidance with this challenging topic...

     

    You said..

    Are there any options when you open the Carrier dropdown?  YES

    If yes, can you check if it has the "UPS" value? YES

    If yes, can you check if it shows the "new_name" column?  (not sure where to look for that question)

    If yes, try to change the code to First(Choices(@[...].new_Carrier)) instead of First(Filter(...))  I tried, but I'm afraid I have a syntax issue.

     

    I'm sorry, I'm not a true developer but a poweruser... Here's what I have now... I feel it's like 99% there...

     

     
  • Verified answer
    CU22081450-0 Profile Picture
    Most Valuable Professional on at
    Re: Cannot set default lookup value on a CDS field

    @testasdfasfsafa ,

     

    No worries! 🙂

    I checked here, and you can use:

    DefaultSelectedItems --> First(Filter(Carrier, new_name = "UPS")) 

     

    2 changes:

    - Default to DefaultSelectedItems

    - "new_name" to new_name

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Renato Romão
    https://www.linkedin.com/in/renatoromao/

  • testasdfasfsafa Profile Picture
    309 on at
    Re: Cannot set default lookup value on a CDS field

    Wow, that was it!! It works just fine now 🙂

     

    I wish I can send more then Kudos!!  (and wish Microsoft would spend more time documenting their tools).

     

    BTW, does the filter approach would also work for choice columns (instead of lookups)?

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at
    Re: Cannot set default lookup value on a CDS field

    Hi @testasdfasfsafa ,

     

    Nice! 😄

     

    No, we just use "UPS" if it is a choice column. 

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

Coming soon: forum hierarchy changes

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 819 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 308 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 222 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics