cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Faye125
Frequent Visitor

Lookup within same Collection

Hi,

 

I am trying to patch a collection but some of the field in my patch are looking up value from SP based on another field within collection and I guess Patching function is faster than lookup so nothing is being patched for the lookup field. 

 

For example: Equipment_Date field has the following formula : If(ThisItem.Assetclass= "10402000 - Equipment",LookUp('Equipment Table',Title= ThisItem.ShipLoc,EQU_Cap_Date),"N/A").

 

Below is my patch code:

Patch(AssetCollection,ThisItem,
{Assetclass: DropAsset.SelectedText.Value, ShipLoc: DropShip.SelectedText.Value, QTY: Value(Input_QTY.Text) , Amount: Value(Input_Amt.Text), Description: Input_Des.Text, Linetotal: Value(Input_QTY.Text)*Value(Input_Amt.Text),
Equipment_Date: Equipment_Date.Text, Furniture_Date: Furniture_Date.Text,Lease_Start_Date: Lease_Start_Date.Text, Lease_Yr: Lease_Yr.Text, Lease_Mo: Lease_Mo.Text, CC: CC.Text, WBS: WBS.Text , ShowSave: false });

 

Is there a way I can patch to the same record in Collection? this way I can break the sections and allow powerapps some time? Or is there a better way to do this? I am asking user to add expense using a gallery. 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Faye125 ,

 

Could you please share more details about your scenario?

 

If I understand correctly, do you want to patch a single collection row and the Equipment_Date value depends on other column value? 

 

If so, why not use the Assetclass value directly in the If statement?

Patch(AssetCollection,ThisItem,
{
Assetclass: DropAsset.SelectedText.Value, 
ShipLoc: DropShip.SelectedText.Value, 
QTY: Value(Input_QTY.Text) , 
Amount: Value(Input_Amt.Text), 
Description: Input_Des.Text, 
Linetotal: Value(Input_QTY.Text)*Value(Input_Amt.Text),
Equipment_Date: If(DropAsset.SelectedText.Value = "10402000 - Equipment",LookUp('Equipment Table',Title= ThisItem.ShipLoc,EQU_Cap_Date),"N/A"), 
Furniture_Date: Furniture_Date.Text,
Lease_Start_Date: Lease_Start_Date.Text, 
Lease_Yr: Lease_Yr.Text, 
Lease_Mo: Lease_Mo.Text, 
CC: CC.Text, 
WBS: WBS.Text , 
ShowSave: false
}
);

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @Faye125 ,

 

Could you please share more details about your scenario?

 

If I understand correctly, do you want to patch a single collection row and the Equipment_Date value depends on other column value? 

 

If so, why not use the Assetclass value directly in the If statement?

Patch(AssetCollection,ThisItem,
{
Assetclass: DropAsset.SelectedText.Value, 
ShipLoc: DropShip.SelectedText.Value, 
QTY: Value(Input_QTY.Text) , 
Amount: Value(Input_Amt.Text), 
Description: Input_Des.Text, 
Linetotal: Value(Input_QTY.Text)*Value(Input_Amt.Text),
Equipment_Date: If(DropAsset.SelectedText.Value = "10402000 - Equipment",LookUp('Equipment Table',Title= ThisItem.ShipLoc,EQU_Cap_Date),"N/A"), 
Furniture_Date: Furniture_Date.Text,
Lease_Start_Date: Lease_Start_Date.Text, 
Lease_Yr: Lease_Yr.Text, 
Lease_Mo: Lease_Mo.Text, 
CC: CC.Text, 
WBS: WBS.Text , 
ShowSave: false
}
);

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Faye125
Frequent Visitor

Thanks.

 

Yes I was over complicating this.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,470)