2

In SharePoint Online (E3 subscription) I have 5 lists in a site and in each list the user is to enter 1 item. The end result is to enable the Create and Edit button conditionally on a page next to text of list name. The only field that could have a unique value in the lists would be Created By. I have the link for Create. I need the link for each list's Edit button as well as how to enable/disable the other links on the page.

  • List 1 Create link enabled, all other links disabled
  • User clicks List 1 Create link, enters data and saves
  • List 1 Edit button enabled, all other links disabled
  • List 1 Field 'Approved' default = False. When supervisor approves data through workflow or field on a page, 'Approved' is ticked becoming True.
  • List 2 Create link enabled, all other links disabled
  • Do for all lists

Format Changes

I have the link to the Edit for each list and the end of the link has 'ID=1'. I don't want to hard code 'ID=1' just in case the item has to be deleted for some reason since it auto number increments.

I have read about creating a workflow that puts a copy of the Created By into a field and check to make sure that field is unique. That works for making sure there is a unique entry. I also need the link for the Edit button as well as the conditional formatting enable/disable.

I could use SP.List.getItems and in the WHERE put in 'Approved'=True

How would I get the ID or would I use Created By = Me

Where would I use the JS and how would I conditionally format text or images on the page?

With all the conditional formatting, do I need to check for a unique record per user?

Is there a different way to think about this?

0

How would I get the ID or would I use Created By = Me You will be using Created By = Me and then fetch the corresponding item to it. If the item count is returned 0, create the item

Where would I use the JS and how would I conditionally format text or images on the page? Just create an HTML file and add javascript and content to it. Then add a content editor webpart on the page and link it to the HTML file

With all the conditional formatting, do I need to check for a unique record per user? Once you implement the Created BY = Me, you won't need to. It will already be checking.

  1. Get items for the current user
  2. Check if itemCount= 0
  3. If rowCount = 0, add the item to the list
  4. else, edit the item

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.