Hi,
I am trying to populate a Word document that contains a table with data from data drawn from a Sharepoint List.
The Course Subject Titles are already in the Word Table. I am only looking to get the date of course completion entered from the Sharepoint List. However, the code I have written is not working as expected.
Desired outcome
I want the code to enter a date in dd/MM/yyyy format if there is a date in the field on the Sharepoint List or, if there is no date in the field of the Sharepoint List, leave the date field blank in the corresponding date field in the Word table.
What is actually happening?
If there is a date in the field in the Sharepoint List it is entering the text "dd/MM/yyyy" and NOT the date.
If there is no date in the field in the Sharepoint List, it is deleting the name of the course subject.
What baffles me is I have only linked the date field in the Word table to the Sharepoint List. There is no link at all in the Course subject field in the Word table
What am I doing wrong?
Here is the code: -
if(empty(item()?['Welfare']),'','dd/MM/yyyy')
Word Table
| Course Subject |
Completed (Yes/No) |
Date Completed |
| Welfare [No linkage but this title gets deleted] |
|
[Linked field with Title 'Welfare'] |
| |
|
|
Any help gratefully received.
Many thanks,
Cliff