Good Morning
I am currently patching a recording and after the patch I created a variable to show the fields visible to edit the new record. For some reason my patch returns the first value in my list and not the new one i just created.
Patch('Suggested Travel',Defaults('Suggested Travel'),
{BookingRef: {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: DataCardValue9.Selected.Id,
Value: DataCardValue9.Selected.Value
}
}
);Notify("New Suggestion has been created, Please complete and submit",NotificationType.Success,5000);
Set(ShowFields,true)
Is there a way this can be achieved.
Hi @Sn3l ,
When you create a new record, the ChangesTable will not automatically select this record, so the form command displays the record selected by the ChangesTable by default. You can consider adding an IF judgment to display a new record if there is a new record submitted.
Best Regards,
Bof
The form is called ChangesForm.
Item Properties
LookUp('Suggested Travel', ID = ChangesTable.Selected.ID)
The reason I set it to this is so that when the users clicks on the above galleryTable "changesTable" it could reflect the record.
Should I possibly put an IF statement on this item.
Hi @Sn3l ,
Could you please tell me what the form's item property is?
Where is the DataCardValue9? It seem to be a control, what is it's items proerty?
Best Regards,
Bof
Hi Bof
Thank you very much for the response.
Onselect on my New Suggestion button, Creates a new record (highlighted in Yellow) and Sets my Form Visible (highlighted in blue) allow the user to complete and submit.
I tried the below listed by adding the varRef. (DataCardValue9 is a lookup Field). Not to sure if this is correct.
It Creates the record Perfect. but as you would notice is it still shows the first field in the form
Set(VarRef,DataCardValue9);
Patch('Suggested Travel',Defaults('Suggested Travel'),
{BookingRef: {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: DataCardValue9.Selected.Id,
Value: DataCardValue9.Selected.Value
}
}
);Notify("New Suggestion has been created, Please complete and submit",NotificationType.Success,5000);
Set(ShowFields,true)
Hi @Sn3l ,
Could you please tell me:
In addition, can you check if this patch is working properly and if the required fields are missing?
Finally , you could use this formula to save the patch record:
Set(VariableName,Patch(XXX))
Best Regards,
Bof
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional