locked
Sign Up with button or hyperlink click RRS feed

  • Question

  • I have a list of items with a lookup column for a single individual. How might I create a button or hyperlink column to allow a user to "sign up" or "un-sign up" for each event item and thus change the lookup column to [Me] to in affect assign them to that item? Thanks!
    Tuesday, October 13, 2015 8:19 PM

Answers

  • Hi ste854,

    According to your description, you might want to update the look up field to current logged in user for each item when clicking a button or a hyperlink to achieve the function similiar with "Sign Up" action.

    What's the field type ? A normal look up field or a Person field ?

    If the field is a lookup field, you can create a button and then update the field value like the code snippet below:

     var PetkaLookupSingle = new SP.FieldLookupValue();  
       PetkaLookupSingle.set_lookupId(2);  
       oListItem.set_item('PetkaLookup', PetkaLookupSingle);  

    If the field type is a Person field, you can update the field value like the code snippet below:

    var singleUser = SP.FieldUserValue.fromUser('Peter Dotsenko');  
       oListItem.set_item('PetkaPersonSingle', singleUser);  

    More information:

    How to set any SP.Field Value with JSOM (Javascript) in Sharepoint 2013 to New SP.Listitem

    Complete basic operations using JavaScript library code in SharePoint 2013

    Thanks

    Best Regards


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, October 15, 2015 8:51 AM