Welcome to the community, @antonyjohn! Have you gone through the support article shared below?
Have you tested the sample XLSForm that has been shared in the support article? The attached sample support article should help you understand how the expressions for the dynamic data attachment can be built.
