Forum Discussion
Error in powerapp code when replacing th existing sharepoint list with new list having same data
- 4 years ago
Hi @SUPRIYAK ,
Firstly, try this syntax
ForAll( Filter( Clc_Befout_list, Temp_Status="New" ) As aPatch, Patch( AOA_TPT_Outage_Process_Demo_Response_SK1, {ID:aPatch.ID}, { Response:aPatch.Response Start_Time: Var_Start_Time, End_Time: Now() } ) )however your issue seems to be with the Response field - is the the original name of the field? Go to your List Settings, select the field and look at the end of the URL at the top to see the actual field name.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
- 4 years ago
It separates different "commands" or code instructions.
Thanks a lot sir... I checked the column name in URL, it was different, and when replaced it in code, everything is working fine again.
Sir please tell why coulmn names are changed after replacing the sharepoint list with different name & same data inside.
Code before changing list:
If(Var_Rot_Selected = "OP Proc",
Set(Var_Befout_Count, First(Sort(Filter(AOA_TPT_outage_demo6,Equip_Name=Var_Eqp_Selected_1, Outage_Step="Before Outage"),ID,Descending)).S_No);
Set(Var_Outage_Count, First(Sort(Filter(AOA_TPT_outage_demo6,Equip_Name=Var_Eqp_Selected_1, Outage_Step="Outage"),ID,Descending)).S_No);
Set(Var_Befser_Count, First(Sort(Filter(AOA_TPT_outage_demo6,Equip_Name=Var_Eqp_Selected_1, Outage_Step="Before Service"),ID, Descending)).S_No);
Set(Var_Service_Count, First(Sort(Filter(AOA_TPT_outage_demo6,Equip_Name=Var_Eqp_Selected_1, Outage_Step="Service"),ID,Descending)).S_No);
Refresh(AOA_TPT_Outage_Process_Demo_Response);
If(Value(LookUp(AOA_TPT_Outage_Process_Demo_Response,And(Equip_Name=Var_Eqp_Selected_1, Response=Blank()),ID))=0,
ClearCollect(Clc_selected_equip_1,Filter(AOA_TPT_outage_demo6, Equip_Name=Var_Eqp_Selected_1));
ForAll(Clc_selected_equip_1,
Patch(AOA_TPT_Outage_Process_Demo_Response,Defaults(AOA_TPT_Outage_Process_Demo_Response),
{Equip_Name:field_1,
Outage_Step:field_2,
S_No:field_3,
Res_Dept:field_4,
Check_Type:field_6,
Check_Para:field_5}));
);
Code after changing sharepoint list:
If(Var_Rot_Selected = "OP Proc",
Set(Var_Befout_Count, First(Sort(Filter(AOA_TPT_outage_demo6_SK,field_1=Var_Eqp_Selected_1, field_2="Before Outage"),ID,Descending)).field_3);
Set(Var_Outage_Count, First(Sort(Filter(AOA_TPT_outage_demo6_SK,field_1=Var_Eqp_Selected_1, field_2="Outage"),ID,Descending)).field_3);
Set(Var_Befser_Count, First(Sort(Filter(AOA_TPT_outage_demo6_SK,field_1=Var_Eqp_Selected_1, field_2="Before Service"),ID, Descending)).field_3);
Set(Var_Service_Count, First(Sort(Filter(AOA_TPT_outage_demo6_SK,field_1=Var_Eqp_Selected_1, field_2="Service"),ID,Descending)).field_3);
Refresh(AOA_TPT_Outage_Process_Demo_Response_SK1);
If(Value(LookUp(AOA_TPT_Outage_Process_Demo_Response_SK1,And(Equip_Name=Var_Eqp_Selected_1, Response=Blank()),ID))=0,
ClearCollect(Clc_selected_equip_1,Filter(AOA_TPT_outage_demo6_SK, field_1=Var_Eqp_Selected_1));
ForAll(Clc_selected_equip_1,
Patch(AOA_TPT_Outage_Process_Demo_Response_SK1,Defaults(AOA_TPT_Outage_Process_Demo_Response_SK1),
{Equip_Name:field_1,
Outage_Step:field_2,
S_No:field_3,
Res_Dept:field_4,
Check_Type:field_6,
Check_Para:field_5}));
);
I have highlighted the code where column names are replaced. kindly help.
- Syndicate_Admin4 years agoAdministrator
Hi @SUPRIYAK ,
Did you import this using Excel? You really need to create the list in SharePoint and then import the content if you want the same field names