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 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

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

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard