Forums

Write action - Auto detect

Maxvl 20 Nov, 2018
Hello

If in Write action - Update data is updated. If in Write action - Insert data is inserted.

If in Write action - Auto detect data is updated but not inserted.
Why is that? What you need to specify so that the insert is?
Thank you
GreyHead 20 Nov, 2018
Hi Maxvl,

The Data Save looks for a record id in the form data - if one is found it updates the existing record, if not it creates new one.

Bob
healyhatman 20 Nov, 2018
Also you're telling it to update only the records that match the user id, account, AND the date. Is that right?
Maxvl 21 Nov, 2018
Right, master need to specify the number every day. Sometimes the number is incorrect, then it is indicated again.
It is not clear why the record is not create...
healyhatman 21 Nov, 2018
use a debug and post the results
Maxvl 22 Nov, 2018
no record is created


healyhatman 22 Nov, 2018
1 Likes
Okay well do it this way.

Have a read data action, the where conditions taken from your update conditions you have now. In the "found"event have a save data set to update. In the "not found" have a save data set to insert.

Auto detect only seems to work when you have an id you're checking on
Maxvl 22 Nov, 2018
what data format do i need to specify for the update to be monthly?
when {date:Y-m} not executed
healyhatman 22 Nov, 2018
Try
EXTRACT(year_month from model.date):{date:Y-m}

Probably won't work and if it doesn't do
YEAR(model.date):{date:Y}
MONTH(model.date):{date:m}
Maxvl 22 Nov, 2018
what is the syntax ?
created(model.date):{date:Y-m}
healyhatman 22 Nov, 2018
Answer
The syntax is what gave you. Replace model.date with the name of your model and date field (so created I suppose)
This topic is locked and no more replies can be posted.