Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Iterate through a SP list with SPD custom action

  Asked By: Damaris    Date: Oct 10    Category: Sharepoint    Views: 2888

I need to create a script to iterate through the fields in a list. At each field
this script needs to run.


If fieldname = 1 'answer was yes
increment counter field
increment score field

If fieldname = 0 'answer was no
increment counter field


Any know of some sample code or a tutorial out there? I've been searching for
some time on this.

Share: 

 

11 Answers Found

 
Answer #1    Answered By: Jim Dominguez     Answered On: Oct 10

Are you familiar with the SharePoint API? How far into this have you
gotten? Give us some details and we'll meet you where you are.

Whatever you do, be sure NOT to keep hitting the list  instance in
SharePoint. Instead, copy the whole thing to memory and loop through it
there; otherwise you're hitting the content DB every time  you check a field.

 
Answer #2    Answered By: Aldo Key     Answered On: Oct 10

Not really familiar with the SP API. I have done everything manually with the
OOTB custom  actions that I am trying to accomplish. Very comfortable with SPD
Workflow. I have downloaded and tried custom action  solutions like this one.

blogit.create.pt/.../Custom-Action-for-\
Sharepoint-Designer.aspx

I'm just not sure how to modify that code  to pull the counter  field from
list, increment by one, then post it back!

 
Answer #3    Answered By: Ronald Ramirez     Answered On: Oct 10

I completely misread your question, ignoring the giant "SPD"
in the subject line.

So to be clear, are you really iterating through a whole list, or just going
through all the fields  of a particular item whose change event has been
triggered?

 
Answer #4    Answered By: Leonard Kim     Answered On: Oct 10

Yeah, I should have put the bit about SPD in the body of the email as well!

I will iterate through the whole list  of fields  whose name starts with Q. Not
actually every item in the list.

 
Answer #5    Answered By: Karla Morrison     Answered On: Oct 10

Feel free to tell me that I am crazy for even thinking about using SPD for this
workflow. I am half thinking that myself.

I did buy the Wrox SPD book. It doesn't explain exactly what I need to do, and I
cannot find any examples of it out there on the web. So that leads me to believe
I am barking up the wrong tree!

 
Answer #6    Answered By: Sandy Griffith     Answered On: Oct 10

Feel free to tell me that I am crazy for even thinking about using SPD for this
workflow. I am half thinking that myself.

I did buy the Wrox SPD book. It doesn't explain exactly what I need to do, and I
cannot find any examples of it out there on the web. So that leads me to believe
I am barking up the wrong tree!

 
Answer #7    Answered By: Ezequiel Sargent     Answered On: Oct 10

Well, .NET is not my strength. So if I can get it done with SPD then I'm good
to go. But I suppose it's only a matter of time  before I need to get comfortable
with it.

 
Answer #8    Answered By: Dakota Shaffer     Answered On: Oct 10

I figured out today how to access SP list  items with the SP object model. Well,
just getting into it actually. This isn't the exact site I used, but the code  is
similar.

sharepointdevwiki.com/display/public/Accessing+list+items+using+the+objec\
t+model?focusedCommentId=8945668

 
Answer #9    Answered By: Shelly Jimenez     Answered On: Oct 10

We actually tried to get this working and it ended up costing us
more time  than it was worth. We ended up using code  but here is the article we
attempted:
sharepointsolutions.blogspot.com/.../looping-through-items-in-sharepo\
int.html

 
Answer #10    Answered By: Krystle Pearson     Answered On: Oct 10

I just saw your review of the Wrox SPD book. I am going to try to
get my hands on it today! Thanks for the review, exactly what I need!

 
Didn't find what you were looking for? Find more on Iterate through a SP list with SPD custom action Or get search suggestion and latest updates.




Tagged: