We have added a custom long field to a delivery template, which is saved in the nmsDelivery-table.
I would like to use the custom field like this AddDays([delivery/@customField], GetDate()) and then save it in a custom datetime field in the broadLogRcp-table upon delivery execution.
I would like to avoid making the change on each delivery-WF in our environment.
In other words: I am looking for a solution where I can make the change on one entity (i.e delivery template or targetMapping).
Can this be done without making a post-processing workflow? What is the best way to do this?
Hi @_lukas_ ,
You can save the additional fields from nms:Delivery to nms:broadLogRcp using Target Mapping too.
Here is the link to a similar query where I'd suggested the steps as to use Target Mapping,
Let me know if you have any futher questions while achieving this.
Thanks for such fast reply.
Do I add this in the nms:recipient target mapping? Or do I need a nms:delivery mapping for this?
Because when trying your suggestion on the nms:recipient mapping, I am stuck on how to reference fields in the delivery-table.
Hi @_lukas_ ,
Yes, the fields you like to pass to your nms:broadLogRcp needs to be added to "nms:recipient" (mapRecipient) Target mapping.
In mapRecipients you need to add the fields (under: Soruce Expression) e.g. [targetData/@feildName] that will be passed from the targeting schema like nms:delivery and then map them to the actual fields (under: Destination) that you have extended in broadLogsRcp table to store this additional data e.g. (@feilds).
Also, you can include information permanently from other tables like the Recipient table by using [recpient/@email].
Below screenshot might help you to understand this better.
In the below screenshot the values of emailType, emailSubject is picked from the targeting workflow that is used to send the delivery, and when delivery is processed these data get automatically stored to the destination path of nms:broadLogRcp
Thanks again for the explanation,
Next question, how do I add this information to targetData without adding it in the WF query activity as "Add data"?
I would like to be able to do this in the delivery activity it self so I can just make this adjustment to the delivery template, otherwise I would need to update all WF's with add data. I have been looking into the "extra script object" in the personalization tab but I don't understand how to use it or if it is possible to use it for this use case.
Sure, I'll help!
But can you share more information on the custom fields that you have added to the delivery template that you like to export to broadLogs too?
Also, could you explain how will be using it to calculate the date, as you mentioned above? and where you will be storing this final calculated date coz this final cal date seems to be the value/field that you like to store in broadLogs?
It is a dynamic date calculation which is based on an input field in the delivery input form. It is stored in daysToAddToCurrentDate in the nms:delivery-schema, by using an extension schema.
So when executing the delivery I would like to set a column in the broadLogRcp-table to AddDays(GetDate() + [delivery/@daysToAddToCurrentDate])
Hi @_lukas_ ,
Though I haven't tested it myself yet, but I'm uncertain that using Object (extra field objects) we can store this calculated information to deliveryLogs via the process of Target Mapping>Storage.
As the ExtraObject will generate an object in the respective delivery which can then be used further in content personalization so you can use this object to calculate the date and display it in the content message to a recipient but I'm afraid if this object field can be further used as a 'Source Expression' in the 'Storage' tab of Target mapping for the deliveryLogs.
Though you can give it a try on your side and see if that help.
That said, I tried sometime more to think of an alternative solution for you, where you do need not to use the 'Add data' in each workflow to add this calculated field column but sorry couldn't find any.
Therefore, in my opinion, to achieve your requirement you might need to use 'Additional data' to calculate your date and then map it in the target mapping as suggested above.
P.S. you can also wait and see if any other community folks have any better suggestions to achieve this than mine.