Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Lookup Formula as Default Value

(1) ShareShare
ReportReport
Posted on by 8

Hi Everyone

 

This is my first post and I am a newby to this but I really do need your assistance or guidance on the matter.

I need to set the default of my dropdown field in form in canvass app to a lookup value based on a value in the new form.

I have done the following but cant seem to get the value for the choice value in my table.

Here is my formula but I have left the RESULT part blank because I don’t know what the exact description should be. I know that I need the Address for the Specific code that was entered. The Address is choice data type. 

DJJVN_0-1720701936091.png

 

I have other fields which are the exact same thing but they are not in a choice field which simplifies the process or formula. Just for reference I have added it below as I want to achieve the same outcome just a different value or column value

DJJVN_1-1720701936092.png

 

If the formula for the Lookup on Longitude lookup works then it means the problem does not lie in the condition part of formula but rather what the result format or data type should be? or am I wrong? 

 

Best Regards

  • DJJVN Profile Picture
    8 on at
    Re: Lookup Formula as Default Value

    Good Day @madlad  @Akshansh-Sharma 

     

    Thank you for your assistance in the matter. I did some fault finding and tried to value variations in order for any error to go away. What seemed to work is to reference the column by means of [ ]. This seems to work and seems so simple but now I dont understand why. Here is the formula that worked. 

     

    LookUp('Customer Collection Record','Stop Code'=DataCardValue3.Text,[Address])
     
    Thanks again
  • madlad Profile Picture
    2,637 Super User 2025 Season 1 on at
    Re: Lookup Formula as Default Value

    @DJJVN 

    This could be because the LookUp is returning a value which isn't valid in this combo box. 

     

    2 Questions:

    - What's the exact error that's being returned in those above images?

    - What's the datasource(or 'items' property) for the combobox?

     

    Let me know!

  • DJJVN Profile Picture
    8 on at
    Re: Lookup Formula as Default Value

    😀No Worries, this is exactly what I want.

     

    My problem is now that the Address.Value does not want to auto populate. I have even tried different references for column value.

    DJJVN_1-1720709697690.png

    DJJVN_2-1720709842748.png

     

    LookUp('Customer Collection Record','Stop Code'= DataCardValue3.Text, Address.Value)  This formula does not work. See below Data Type and Column Name. I dont know what I am missing. 
    DJJVN_0-1720709541130.png

     

  • Akshansh-Sharma Profile Picture
    281 Super User 2025 Season 1 on at
    Re: Lookup Formula as Default Value

    @DJJVN  

     

    Thanks for sharing the info, just like @madlad described if you are using a choice column on the items property you need to retreive the choice column as an output of your lookup with .Value to refer the actual value inside of that column and it will autopopulate your drop down without any issues

     

    Let us know how it plays out for you

     

    --------------------------------------------------------------------------------------------------------------------

    Please click Accept as solution if my post helped you solve your issue. If the content was useful in other ways, please consider giving it Thumbs Up 😉

     

    LinkedIn- https://www.linkedin.com/in/akshansharma/

  • madlad Profile Picture
    2,637 Super User 2025 Season 1 on at
    Re: Lookup Formula as Default Value

    @DJJVN Sorry about that, I completely misread😅

     

    I hope I understand now, you need to perform a lookup, but the column you want to retrieve is a choice column, which causes issues? Let me know if I'm still misunderstanding here.

     

    If you're trying to reference a choice column in a lookup like this, you could include a ".Value" after your column name - this will return the text value of the result, rather than the choice record.

     

     

    LookUp(
     'Customer Collection Record', 
     'Stop Code' = DataCardValue3.Text, 
     *AddressChoiceColumn*.Value
    )

     

    ^Just add in the applicable choice column name here

     

    Let me know! 🙂

  • DJJVN Profile Picture
    8 on at
    Re: Lookup Formula as Default Value

    Hi @Akshansh-Sharma 

     

    I think I am referring to the same source.

    DJJVN_0-1720705512072.png

     

  • DJJVN Profile Picture
    8 on at
    Re: Lookup Formula as Default Value

    Hi @madlad 

    Thank you for the feedback but I think the message didnt come through correctly.

     

    I left the last part or the result part open as I dont know what should be inserted to show a result. I do agree that the formula will not work should it end with the comma, even if I remove the comma I wont achieve my result which is the dropdown/choice value within a data table associated to the matching Stop Code as per condition in formula. 

     

    Thanks

  • Akshansh-Sharma Profile Picture
    281 Super User 2025 Season 1 on at
    Re: Lookup Formula as Default Value

    Hi @DJJVN ,

     

    Can you please tell me what the code on the items property of that dropdown because to make the Default property work both the Items and Default property should be connected to the same data source

     

    If you can make sure both are using the same data source then we can further debug why it's not auto populating

     

    --------------------------------------------------------------------------------------------------------------------

    Please click Accept as solution if my post helped you solve your issue. If the content was useful in other ways, please consider giving it Thumbs Up 😉

     

    LinkedIn- https://www.linkedin.com/in/akshansharma/

  • madlad Profile Picture
    2,637 Super User 2025 Season 1 on at
    Re: Lookup Formula as Default Value

    Hi!

     

    It looks like you have an extra comma at the end of the LookUp, removing it should fix this!

     

    LookUp('Customer Collection Record', 'Stop Code' = DataCardValue3.Text,) <- this comma suggests that there will be a third parameter passed. When there isn't one, it throws an error. 

     

    Hope this helps! 🙂

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard