0

I want to add a button for each row in all items view with these conditions:

if the status field is not complete and the ( created date - today) is 5 , show reminder button to send reminder to the assigned to field

1

You need to use JavaScript to achieve your requirement.

Use JSOM to compare the date field value with the current date, and generate the path based on the compare result and overwrite the column value.

Demo about how to overwrite the field value:

<script type="text/javascript">
(function () {
    var overrideNameField = {}; 
    overrideNameField.Templates = {};
    // This action will edit the “Title” field. You can change the “Title” to another custom field. 
                //"LinkTitle" is the internal name of the "Title" field
    overrideNameField.Templates.Fields = {
        "LinkTitle": { "View": overrideNameFieldTemplate }        
    };    
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideNameField);
})();

function overrideNameFieldTemplate(ctx) { 

    //get the current item id
    var itemId = ctx.CurrentItem.ID;
    //get the current item title
    var content = ctx.CurrentItem["Title"];
    //get the current item status
    var status = ctx.CurrentItem["Status"];
    //get the current item status
var date = ctx.CurrentItem["Created"];
                //get the user from a People or Group column
                var user=ctx.CurrentItem["AssignedTo"];
                var userEmail = user[0].email;

                var link = "";
                if (….){
                // conditions: if status field is not complete and the ( created date - today) is 5
                                link = "…";
                } else{
                                link = "…";
                }

    return link;  
}
</script>

How to compare Date Input with Today’s Date using JavaScript

If want to send reminder emails based on conditions automatically, you can create a SharePoint Designer workflow.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.