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 / Collect lookup collumn...
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:
I have the same question (0)
  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    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

  • CU22100725-0 Profile Picture
    129 on at

    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

     

     

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    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

    Hi @Ethan_R ,

     

    Sure I can make some screenshot

     

    TomVictor_1-1685705920517.png

     

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    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

    Hi @Ethan_R ,

     

    Thanks for the help, it now works nicely !

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

#2
11manish Profile Picture

11manish 224

#3
Valantis Profile Picture

Valantis 181

Last 30 days Overall leaderboard