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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Referencing a record o...
Power Apps
Answered

Referencing a record on DefaultSelectedItems then Patch/Update SP list

(0) ShareShare
ReportReport
Posted on by 65

Hi everyone,
Beginner here so I do apologize in advance if I'm a little slow. 🙂
A bit of context to what I’m doing.

 

I have three sharepoint lists – Company, Contractor and Visits
Contractor has a Company column lookup dropdown choice.
The app I'm making is like this.

 

Screens :
Homepage with Add Company button.
Gallery of SP Company list with an ADD button for a new company
Add company form then submit button
Add Contractor form - This is the part I’m having an issue with, on the SP Contractor list "Company" lookup column I want to reference and defaultselecteditems the new company. I’m not sure how to go about this and then what happens OnSuccess? Do I need to patch or update the company column on Contractor list?

Thanks!

Categories:
  • elseb Profile Picture
    774 Moderator on at

    Hi,

     

    using the button that takes you to the add contractor form you can set a variable to the company of your choice and then set the drop down default value to this variable.

     

    Seb

  • Jayautex Profile Picture
    65 on at

    Thanks Seb

    I get what you're saying, but I think I'm a bit confused of how to set a variable that's a text and then the dropdown value as a record if I'm making sense?

  • elseb Profile Picture
    774 Moderator on at

    right lets rewind, how do you get the table that is used as a drop down list?

     

    seb

  • Jayautex Profile Picture
    65 on at

    Apologies for being slow. Company combobox Items : Choices([@Contractor].Company)

    Form below

    Jayautex_0-1691018610247.png

     

  • elseb Profile Picture
    774 Moderator on at

    Hi,

     

    Right so you want a certain company to be selected in the company combobox when you get to this screen, is that correct?

    also are you using combo boxes because you have hundreds of choices or do you need to select more then one at a time?

     

    Seb

  • Jayautex Profile Picture
    65 on at

    Hiya,

     

    I want the newest company to be selected that was just added on the company form. Combobox, with only one choice at a time. Basically once a new company is entered on the company form, the contractor form needs to reference that new company, then after a new contractor is entered, a booking/visit is referenced from that contractor. if that makes sense?

  • elseb Profile Picture
    774 Moderator on at

    Hi,

     

    I think i understand, first of all dropdowns are much easier to work with so i would use those unless you really need to (e.g. multichoice etc).

     

    but back to your question if you stick with the combo and i assume you have it all set to display whatever column you need from your companies list, all you need to do to set the default selection to the latest record is:

     

    in your DefaultSelectedItems property of the combobox put:  Last(colCompaniesCollection)

     

    Seb

     

  • Jayautex Profile Picture
    65 on at

    Ah I see, thanks. I think when I add the form and connect it to a database, it automatically assigns a combobox instead of just a dropdown. I'll give that a go. After submitting the form, would that automatically update the record on the SP list? or do I need to patch it manually?

  • elseb Profile Picture
    774 Moderator on at

    I assume if the combo was created from the splist then it should update it using the form, I won’t lie I don’t know much about forms i moved away from them in the first week with powerapps as they were super limiting for me.

     

    Seb

  • Jayautex Profile Picture
    65 on at

    I've had no luck converting/referencing these lookup tables from text to records. I think I might have to just scrap this and start over my SP lists without lookup columns.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard