Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Collect lookup collumn in dataverse

(0) ShareShare
ReportReport
Posted on by 129

Hi,

 

I've tried to collect some data in a editable grid, I have 2 lookup column in my dataverse that I use in my grid. My problem is that I can't collect the data modified in the grid.

 

I use that as a formula:

If(
 ThisItem.'CRM - Commande' in colTaskUpdatesCommande.'CRM - Commande';
 Update(
 colTaskUpdatesCommande; 
 LookUp(
 colTaskUpdatesCommande;
 'CRM - Commande' = ThisItem.'CRM - Commande');
 {
 
 }
 );
Collect(
 colTaskUpdatesCommande;
 {
 Client: DropdownCanvas1.Selected;
 Commande: TextInputCanvas1.Value;
 'Date de commande': DatePickerCanvas1.Value;
 'Description commande': TextInputCanvas1_1.Value;
 'Condition de facturation': DropdownCanvas1_1.Selected;
 'CRM - Commande': ThisItem.'CRM - Commande'
 }
)

 

If someone can help me it would be appreciated.

Thanks,

Tom Victor

Categories:
  • CU22100725-0 Profile Picture
    129 on at
    Re: Collect lookup collumn in dataverse

    Hi @Ethan_R ,

     

    Thanks for the help, it now works nicely !

  • Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on at
    Re: Collect lookup collumn in dataverse

    Hi @TomVictor ,

     

    Your Lookup code will is showing error because you are comparing Text and Record datatype

     

    //Code will be
    
    LookUp( 'CRM - Client'; Client = combobox7.Selected.Client; ThisRecord)

     

     

    Please ensure brackets and datatypes are proper for this to work

  • CU22100725-0 Profile Picture
    129 on at
    Re: Collect lookup collumn in dataverse

    Hi @Ethan_R ,

     

    Sure I can make some screenshot

     

    TomVictor_1-1685705920517.png

     

  • Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on at
    Re: Collect lookup collumn in dataverse

    Hi @TomVictor ,
    Can you share a screenshot of the error and the part where it is highlight?

     

    Just to make the format clear, here's what I implemented long ago which works without issue:

    Ethan_R_0-1685705305267.png

     

     

  • CU22100725-0 Profile Picture
    129 on at
    Re: Collect lookup collumn in dataverse

    Hi @Ethan_R 

    Thanks for your reply, it doesn't seems to work for me, I cannot compare the first part of your formula. It says that I can't compare a Text with a Record

     

     

  • Verified answer
    Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on at
    Re: Collect lookup collumn in dataverse

    Hi @TomVictor ,

     

    Just check if you have ',' commas as separator or ';' semi-colon. 

    I use commas so I wrote the code:

    If(
     ThisItem.'CRM - Commande' in colTaskUpdatesCommande.'CRM - Commande',
     Update(
     colTaskUpdatesCommande,
     LookUp(
     colTaskUpdatesCommande;
     'CRM - Commande' = ThisItem.'CRM - Commande'
     ),
     {
     Client: LookUp(
     Clients,
     ClientID = DropdownCanvas1.Selected.ID,
     ThisRecord
     ),
     Commande: TextInputCanvas1.Value,
     'Date de commande': DatePickerCanvas1.Value,
     'Description commande': TextInputCanvas1_1.Value,
     'Condition de facturation': DropdownCanvas1_1.Selected
     }
     ),
     Collect
     (
     colTaskUpdatesCommande;
     {
     Client: LookUp(
     Clients,
     ClientID = DropdownCanvas1.Selected.ID,
     ThisRecord
     ),
     Commande: TextInputCanvas1.Value,
     'Date de commande': DatePickerCanvas1.Value,
     'Description commande': TextInputCanvas1_1.Value,
     'Condition de facturation': DropdownCanvas1_1.Selected,
     'CRM - Commande': ThisItem.'CRM - Commande'
     }
     )
    )

     

    Considering that Client is lookup value, you need to capture the record completely instead of just dropdown.selected. As it sometimes doesn't update values properly when working on large datasets.

     

    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard