I don't know if this is possible so please let me know. Here's what i'm trying to accomplish.
I have two lists within the same site - List A & List B.
List A contains three columns: Name, Week, Information.
List B contains four columns: Name, Week 11/5/15, Week 11/16/15, Received
A user will come into List A, give their name, select the week (ex. 11/5/15) from a pre-populated drop down menu, and save.
A workflow should then run that does the following:
Basically if someone submits something in List A, I want to mark them as being compliant in List B.
I understand how to use a collection variable to sort through IDs and assign variables to test BUT i'm wondering how i can get the workflow to recognize what column it should update.
If my users "Week" is stored in the variable weekOf, i need to be able to see which column name it matches.
Is this possible? Is there a way to dynamically pull the column titles of a list and use it in a workflow?
Solved! Go to Solution.
You could get the list of columns in your list via a REST call
if you only have these two choices, it would probably be better to use a simple If or Switch action, to decide which option has been selected, like this:
The option Fernando talked about is using the SharePoint native webservices, which offer a lot more options, but are also more complex.
You could do this using the following steps as a rough outline (but I really recommend the first option as it is much simpler😞
Hope this helps!
You might try separating out the weeks into sub folders within the list instead of trying to make them columns especially if you'll be dynamically adding additional columns, it would be far easier to dynamically add a folder then a column and it could be used as a dataset.
first find the date folder that's appropriate, build the URL based on a format you choose:
Then read the items in the list located in that folder. Just another way to skin the cat...I'm sure there's other ways, but that seems far simpler then messing around with workflows, queries and column names especially if you'll be adding more columns dynamically later. This method can scale up as you go very easily.
There will actually be more columns in List B. There would be a column for each upcoming week. So the number of columns is not certain. Although the column name will be added manually each week.Martin Zierler
The end user needs to be able to quickly view if the employees have submitted for the week. I would really like to keep this layout where the room numbers and names stay the same but each week a new column is added. When the user submits via the other form, the cell for that user and week is updated to Received
I would have to venture that "creating a column" would not be best practice. Most of the time when you want to create a list you keep the structure of that list static. The data within those columns would be dynamic and you would build your structure accordingly to be able to handle whatever data is in it. If you had a SQL database, you wouldn't add columns to that post-Production release. you'd modify your structure only if needed because (usually) changing database structure requires change requests and other red tape. Nobody likes that so you should design the structure so you can obtain data and dynamically control it with that structure.
Reading over you original post, you're asking "is this possible?" Yes but why would you do this in the first place?
From the looks of it, you just need to create an excel spreadsheet and manually add the columns in each week as users make it and store that spreadsheet in a document library.
If it was me, I'd have a list that has all the weeks of data:
Then create a view that would filter by week, copy paste into excel and send that report. Maybe someone can assist with creating THAT in a workflow over you trying to manipulate your data structure each week to add more columns. Views and filters are where SharePoint shines. You should make use of those instead of trying to force a list into a report.
You could even create a view that would be filtered by the "received" column where you could display all users that you have not received reports from...or you could filter by the room where you could see which week you haven't got the room info yet and which user is responsible for it.
The whole method of adding a column just isn't really best practice. A list is a dataset, and it should be treated as such, not treated as a reporting tool. That may be where the difficulty here lies. You're really not using the list for what its intended to do: Store data.
Thanks for the suggestion. Let me give you a little background. The user was originally recieving 20 or so reports each week, then updating an excel sheet - similar to the one you were talking about.
The goal was to automate that process.
So the first step was to create a list in SharePoint where users could submit their weekly reports.
But now it's the manual part of tracking who has submitted.
I'm totally fine with creating the columns manually in advance but i would still like to see the list updated.
Take a look at this image i've attached.
Do you get what i'm trying to do now?