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 Apps
Suggested Answer

ForAll Patch Issue

(0) ShareShare
ReportReport
Posted on by 71
I am having issues with patching a collection value into Dataverse lookup column.
 
1st i have a gallery which the user can select multiple assets from a dataverse table called Assets
 
 
2nd once they select multiple assets they are taking to an Asset Booking screen with a dataverse table called Asset Bookings where they select the start and end date

 
Finally i want the "Book All Assets button to loop through a for all and apply the start and end date to each selected asset and create a new line in the Asset Bookings table but i cant get the formula to apply the Asset ID into the lookup column

I have this so far, i've been stuck for so long, can anyone please help???
 
ForAll(
    selectedAsset //MY COLLECTION TAKEN FROM THE ASSET GALLERY
     As BOOKINGS,
    Patch(
        'Asset Bookings', //MY ASSET BOOKING DATAVERSE tABLE
        Defaults('Asset Bookings'),
        {
            Asset: // THE THING I CANT GET TO WORK
 
            'Booking Date': PBStartDate.SelectedDate,
            'Return Date': PBEndDate.SelectedDate,
     
       
        }
    )
);
Categories:
I have the same question (0)
  • Suggested answer
    LessCodePaths Profile Picture
    100 on at
    Hi,
     
    to patch dataverse lookup column you need to use object matching related table.
    I assume that selectedAssets is collection which holds objects matching related table.
     
    Formula should work:
    ForAll(
        selectedAsset //MY COLLECTION TAKEN FROM THE ASSET GALLERY
         As BOOKINGS,
        Patch(
            'Asset Bookings', //MY ASSET BOOKING DATAVERSE tABLE
            Defaults('Asset Bookings'),
            {
                BOOKINGS, 
                'Booking Date': PBStartDate.SelectedDate,
                'Return Date': PBEndDate.SelectedDate,
            }
        )
    );
    
    
    Let me know if it helps.
    L.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard