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 Apps / Setting the Default Va...
Power Apps
Unanswered

Setting the Default Value for a LookUp Field

(0) ShareShare
ReportReport
Posted on by 58

Hi Guys,

 

I need help regarding the following problem:

Iam using my ContactNewForm for adding contacts to the SP list "dbcontact". After submitting the form my function is saving the submitted Form (Column "ID") in a variable (varSubmitRec). After the form is submitted I do also navigate to another screen using a second form for adding a Task (linked to the contact). That form is used to add an entry to the SP list "tasks". That list has a column that contains lookup fields linked to the SP list "contacts" (here linked to column -> ID). So the goal here is to be able to create a task linked to the new created contact. Therefore Iam trying to set the Default Value of the lookup field (contactID) in the Form TaskNew with the variable "varSubmitRec" containing the actual (new) ID of the created contact within the SP list "contacts".

 

However that does not work. Is it possible to preselect the lookup field with the variable containing the linked ID and if so, how?

 

Greetings

René

Categories:
I have the same question (0)
  • IamTrying Profile Picture
    58 on at

    I tried this settings within "Default":

    LookUp(Choices(dbKontakt.ID);Value=varRecordFormCurrent)

     

    That does not work either...

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @IamTrying 

    When you create a new Contact in your contact form, in the OnSuccess property:

    Set(varSubmitRec, Self.LastSubmit)  This will hold your contact record until you add another one or pick one from the gallery. 

    In your Tasks list make sure the type of column for contactID is a number type.  In the Tasks form, set the Update property of the contactID card to:  varSubmitRec.ID and hide the card. (the user should never have access to change it).  The Item property of the Tasks form should be: Lookup(Tasks, contactID=varSubmitRec.ID) 

    If you are adding another task to an existing contact record selected in the contacts gallery, the icon in contacts gallery's OnSelect property should be

    Set(varSubmitRec, ThisItem); NewForm(TaskNew);Navigate(YourTaskScreen)

  • IamTrying Profile Picture
    58 on at

    Hi Drrickryp,

     

    thank you for your answer.

    I think the problem is, that the column for contactID is a LookUp type that is linked to the dbcontact list. Do I have to change the type to "number"? Because in that case I would loose the connection to the task list. My plan was to habe connected SP lists.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
  • Verified answer
    IamTrying Profile Picture
    58 on at

    Allright I think I got it. So no lookup columns then. Thank you mate!

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard