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 / Patching LookUp column...
Power Apps
Unanswered

Patching LookUp columns to dataverse Using Combobox

(0) ShareShare
ReportReport
Posted on by

Hello Great community,

I'm loosing my mind over here, struggling with a problem that I've spent 3 days without any advancement at all.

I'm new to Dataverse and have previously been using Sharepoint as my data source which this problem would not be so difficult if it were SP.

So I've a Master Table List with multiple LookUp columns. I got plenty of comboboxes which the user should select values and if none is found write the new value in the combobox.

Then I want to collect all those values in to a collection, which seems to work, However i struggle with the patch function.
i Can't seem to be able how to patch these new values written in the combobox control.... When i select the values already provided from the combobox, there's no issues but when i write new values, the new values does not appear in the Table, they patch as empty...


What am I doing wrong!!?!?!?



App_Layout.PNG
Collect_Formula.PNG
Patch_Formula.PNG
Categories:
  • BCLS776 Profile Picture
    8,994 Moderator on at

    There are a couple of things going on here:

    1. ForAll() combined with Patch() needs an As operator for disambiguation
    2. Dataverse lookup columns support record references

    For these reasons, try refining your code to something more like:

    // for the collection
    Collect(
     colLev;
     {
     colSup: supCombo.Selected;
     colOrd: orderTxtInp.Text;
     colArt: artCombo.Selected
     // and so on
     }
    )

     

    ForAll(colLev As aItem;
     Patch(
     'Inleveranser 20245';
     Defaults('Inleveranser 20245');
     {
     OrderNumber: aItem.colOrd;
     Department: aItem.colDep; // This is a record reference from your collection
     // and so on
     })
    )

     

    I assume you will be collecting more than one record for the Patch(), which is why you are handling this through a collection, but if not consider eliminating that step and its complexity.

     

    Hope that helps,

    Bryan

  • VincentGiovanni Profile Picture
    on at

    Hello @BCLS776 

    Thanks for the quick response.
    A couple of questions and wonderings, in the collection formula I've for example :

    Collect(
        colLev;
        {
            colSup: If(IsBlank(supCombo.Selected);supCombo.SearchText;supCombo.Selected.'Supplier Name');
     
    Because if the user can't find the value from the dropdown control, then they should be able to write their own value in the combobox and collect that written value aswell, do you mean for me to remove that part?

    Also when i wrote the new patch formula i tried and it returns an error message saying that 'Argument type "column-Name" does not meet the expected type 'record' found Type Text?



  • VincentGiovanni Profile Picture
    on at

    The reason for me using a collection is because this is for our warehouse management where we will insert information from the delivery notes from each order, so 1 collection per order let's say, of course there's no obligation but would be simplier in a logistic point of view for writing a collection of items related to an order instead of patching individual "rows" so to speak.

  • BCLS776 Profile Picture
    8,994 Moderator on at

    @VincentGiovanni wrote:

    Hello Great community,

    I'm loosing my mind over here, struggling with a problem that I've spent 3 days without any advancement at all.

    I'm new to Dataverse and have previously been using Sharepoint as my data source which this problem would not be so difficult if it were SP.

    So I've a Master Table List with multiple LookUp columns. I got plenty of comboboxes which the user should select values and if none is found write the new value in the combobox.

    Then I want to collect all those values in to a collection, which seems to work, However i struggle with the patch function.
    i Can't seem to be able how to patch these new values written in the combobox control.... When i select the values already provided from the combobox, there's no issues but when i write new values, the new values does not appear in the Table, they patch as empty...


    What am I doing wrong!!?!?!?




    You'll have to create additional functionality to handle the users being able to enter in their own values in a combo box, and the reason why is are not able to save a text string to the same field that is expecting a record reference. In fact, the error you are seeing about argument type is likely the same issue - a column expecting a string must receive a string and column expecting a record (a lookup) must receive a record. Power Apps is pretty strict with enforcing data types.

     

    Bryan

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 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard