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 / 3 consecutive patches ...
Power Apps
Unanswered

3 consecutive patches that know about previous one.

(0) ShareShare
ReportReport
Posted on by 99

Hello, 

I try to patch 3 different tables that one refers to another right now I have a solution that does patch only two, but cannot think of any way to add 3rd patch. 

 

With(
 Patch(
 Tickets,
 Defaults(Tickets),
 {'Ticket Status': 'Ticket Status'.'Not Started'}
 ) As Ticketz,
 ForAll(
 material_final,
 Patch(
 ' Materials',
 Defaults(' Materials'),
 {
 'Material Number': ThisRecord.Material,
 'Related Ticket ID': Ticketz
 }
 )
 ) As Materialz
);

 

tried to do it with nested 'with' but always met with an error. Last patch is meant to refer to each material created.

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @supra ,

     

    You got the syntax for the With function wrong. It should look something like the below:

     

    With(
     {	
    		Ticketz: Patch(
    			Tickets,
    			Defaults(Tickets),
    			{'Ticket Status': 'Ticket Status'.'Not Started'}
    		)
    	},
    	With(
    		{
    			Materialz: ForAll(
    				material_final,
    				Patch(
    				' Materials',
    				Defaults(' Materials'),
    					{
    					'Material Number': ThisRecord.Material,
    					'Related Ticket ID': Ticketz
    					}
    				)
    			)
    		},
    		Patch(
    			DataSourceName,
    			ItemID,
    			{
    			ColumnName: Materialz
    			}
    		)
    	)
    );
  • supra Profile Picture
    99 on at

    @BCBuizer Nice with your help i got a little bit closer, but now we refer to Materialz as a table how should i divide it for single record? 

    With(
     Patch(
     Tickets,
     Defaults(Tickets),
     {'Ticket Status': 'Ticket Status'.'Not Started'}
     ) As Ticketz,With(
    		{
    			Materialz: ForAll(
    				material_final,
    				Patch(
    				' Materials',
    				Defaults(' Materials'),
    					{
    					'Material Number': ThisRecord.Material,
    					'Related Ticket ID': Ticketz
    					}
    				)
    			)
    		},
    		Patch(
    			'Material Tasks',
    			Defaults('Material Tasks'),
    			{
    			'Material Reference': Materialz
    			}
    		)
    	)
    );
  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @supra ,

     

    Try inserting another ForAll function:

     

    With(
     Patch(
     Tickets,
     Defaults(Tickets),
     {'Ticket Status': 'Ticket Status'.'Not Started'}
     ) As Ticketz,With(
    		{
    			Materialz: ForAll(
    				material_final,
    				Patch(
    				' Materials',
    				Defaults(' Materials'),
    					{
    					'Material Number': ThisRecord.Material,
    					'Related Ticket ID': Ticketz
    					}
    				)
    			)
    		},
    		ForAll(
    			Materialz,
    			Patch(
    				'Material Tasks',
    				Defaults('Material Tasks'),
    				{
    				'Material Reference': ThisRecord.Value
    				}
    			)
    		)
    	)
    );

    Probably you'll need to change .Value to the name in the column of Materialz you want to patch to the Material Reference column.

  • supra Profile Picture
    99 on at

    For some reason now it gives me an error that 'Material Reference' column doesnt exist.

  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @supra,

     

    Can you please share a screenshot of the formula bas with all of the red squiggly lines? That may give a bit more of a clue.

     

    When testing (with SharePoint) these syntaxes were working for me.

  • supra Profile Picture
    99 on at

    Oh, i should have mentioned that tables are in dataverse... 

    supra_0-1685438741154.png

    It is basically pasted from your solution.

     

  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @supra ,

     

    Can you check if 'Material Tasks' is the correct reference for the table you're trying to patch? Judging from the triple squiggly lines, Power Apps is not happy with it. That will also be the reason why the 'Material Reference' column is not found.

  • supra Profile Picture
    99 on at

    @BCBuizer 
    Double checked everything, but all proposed columns are from ' Materials' table for some reason, although Patch is made on 'Material Tasks' 

  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @supra,

     

    Then let's try a different approach with nesting the Patch functions:

     

    ForAll(
    	ForAll(
    		material_final,
    		Patch(
    			' Materials',
    			Defaults(' Materials'),
    			{
    				'Material Number': ThisRecord.Material,
    				'Related Ticket ID': Patch(
    					Tickets,
    					Defaults(Tickets),
    					{	
    						'Ticket Status': 'Ticket Status'.'Not Started'
    					}
    				)
    			}
    		)
    	),
    	Patch(
    		'Material Tasks',
    		Defaults('Material Tasks'),
    		{
    			'Material Reference': ThisRecord
    		}
    	)
    );
  • supra Profile Picture
    99 on at

    @BCBuizer 
    Unfortunately same problem.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard