As requested by several users I have created a code example to show how you can add a list item in another list (List_B) in the SharePoint site from Custom JS in the Modern DFFS context.
The attached code will create a new item in List_B when the current item is saved. Only the function dffs_PostSaveAction needs to be changed. Read the comments in the code for more details.
Other than the getFieldValue and dffs_showModal functions, this code is not specific for DFFS – it uses standard SharePoint REST API endpoints.
Let me know if you have any questions related to the code in the comments below.
Best regards,
Alexander