Skip to main content
Nintex Community Menu Bar

Add 'Created by' to a Form

  • May 25, 2016
  • 6 replies
  • 58 views

kmccool
Forum|alt.badge.img+9

I would like to show the created by field on my form and I cant seem to find it anywhere!

It will be hidden in edit and new mode. this way the approvers can view the form and see who created it even though it also says this in the workflow notification. confused.png

Can anyone tell me where it is...

Thanks

Kassie

6 replies

Forum|alt.badge.img+16

you could add a calculated value control to your form and set the formula builder to be item property - created by?


kmccool
Forum|alt.badge.img+9
  • Author
  • Scholar
  • May 25, 2016

I tried that with no luck... the return was Value1! or something like that.

I did have success adding a rich text field and inserting Created by as a reference. Thanks for the help with getting me to think outside the box! happy.png

Kassie


Forum|alt.badge.img+16

ah cool - have to say I didn't try it before I suggested it ooops


kmccool
Forum|alt.badge.img+9
  • Author
  • Scholar
  • May 25, 2016

I may have done it wrong. I'm new to forms. :-/


Forum|alt.badge.img+7
  • May 26, 2016

Hello Kassie,

Use calculated column column on Nintex Forms and put CreatedBy item property in the formula section.

Also change Recalculate formula on view mode to Yes.

This way, you can see the created by person name on View and Edit mode.


Forum|alt.badge.img+7
  • May 26, 2016

Hi,

If you add a single line text control with the following settings:

185331_pastedImage_1.png

Then paste the following in the Custom JavaScript it should work.

NWF.FormFiller.Events.RegisterAfterReady(function () {
   
    function getUserById(id) {
        var mypersonurl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/GetUserById(" + id + ")";

        var calluser = NWF$.ajax({
            url: mypersonurl,
            type: "GET",
            dataType: "json",
            headers: { Accept: "application/json;odata=verbose" }
        });

        calluser.done(function (data, textStatus, jqXHR) {
            var authorname = data.d.Title;
            NWF$("#" + txtCreatedBy).val(authorname);
        });
    };

    function getUrlVars() {
        var vars = [],
            hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
        for (var i = 0; i < hashes.length; i++) {
            hash = hashes.split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
    };

    var itemid = getUrlVars()["ID"];
    var myurl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getById('" + _spPageContextInfo.pageListId + "')/items(" + itemid + ")";

    var call = NWF$.ajax({
        url: myurl,
        type: "GET",
        dataType: "json",
        headers: { Accept: "application/json;odata=verbose" }
    });

    call.done(function (data, textStatus, jqXHR) {
        var author = data.d.AuthorId;
        getUserById(author);
    });
});

Jan