Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code - InfoPath Dev
in

InfoPath Dev

Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

Last post 09-14-2015 02:02 PM by Hilary Stoupa. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 09-09-2015 11:11 AM

    Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

    The subject pretty much sums it up. (Emphasis on "without code")

    I have a list of coordinators among other data in a form parameter SharePoint list that gets loaded on form load. The schema of the list as follows: Title, UserID, ParameterKey, ParameterValue, ID. I just need the first two.

    Ultimately what I need is for InfoPath to get the user's email address from the user ID's in the list, concatenate them into a semicolon field that I can promote so a SharePoint workflow can grab it and send emails to those users. 

    Currently there are 3 Service Managers in the list. I have no problem getting the users either in a repeating table or a dropdown/combo box using filtering to get just the "Service Managers"

     

    To do this I see that I need to perform the following steps:

    1. Load the users ID in the list filtered by the title "Service Manager." (I can do this)
    2. Get the user ID's query the ID with our ActiveDirectory web service and return the "mail" field. (I can do all this, but not in a single operation in a repeating table or something in InfoPath)
    3. Concatenate the email into a InfoPath field, semicolon delimited.
    4. Promote that InfoPath field.
    5. Write the workflow to use the promoted field in the "Send To" field.

    I have successfully created repeating tables, combo/dropdown/Listboxes and put the usedID data in it without any problem.

    What I am having trouble with is accessing that list, so to use that info to query our activeDirectory webservice, and somehow put the resulting email address in a flat text field that I can promote.

    Seems that once it is in the repeating table, it's done, and I can't get the info or do anything more with it.

     


     

  • 09-09-2015 04:05 PM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

     So, you can aggregate the repeating field using a double eval formula - here's an example: http://blogs.msdn.com/b/infopath/archive/2006/04/05/569338.aspx

    Do you really need the email address? If your workflow sends to the users account ID, won't that automatically resolve to their email address? 

    Hilary Stoupa

  • 09-10-2015 06:48 AM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

     That's interesting. I didn't know SharePoint would do that. (I'm still quite the SharePoint newbie.) I guess this post shows I should have put this question in the "Newbie" forum, huh?

     So, now all I need to do is take the userID's from the list, concat them separated with a semicolon, and promote them. Then the workflow can grab them and email the notifications.

    That eliminates all the webservice work getting the emails out of active directory.

     

    You are so smart Hilary! That's why we all luv you!  And... You're cute to boot!

     

    Thanks!

     

  • 09-10-2015 07:36 AM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

    Ha - you just made my day. So one way you could test this is just set up a workflow that sends an email, like on a test list or something, and use a column from the test list for the "To" in the email... then create a list item that is semicolon delimited user ids. See if the email gets sent as anticipated. When you know that will work (and hey, it seems like every SharePoint environment is special in its own way, right?) then you can take care of the rest of this - getting the double eval put together and promoted, etc. I like to break things down and make sure I have a proof of concept of the different moving parts when I'm uncertain. :)
    Hilary Stoupa

  • 09-14-2015 10:28 AM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

     Hi Hilary,

     The formula in the link you gave me is: eval(eval(person, "concat(my:email, ';')"), "..")
    They are using a repeating table to hold the information.
     

    Is there a way to do this directly at a data connection input level? (I'm not sure I'm being clear here.)

    Maybe this will make my question more clear:

    *  I read the users from a SharePoint Parameter list.
    * Can I just fill a field at that point using a double eval function, or do I have to load a repeating table, listbox or some other repeating control and then fill a field using a double eval function?

    If so, what would be the formula?

    My Parameter List Schema is:
    Title,
    Parameter1,
    Parameter2 

    Although there is other data iin the list, the data in the list I'm interested in is in the following format:
    Title="User", Parameter1="UserFirstName", Parameter2="UserID" (I'm really not interested in Parameter1 for this operation.)

    The name of the InfoPath field is "UserEmailIDs" and the SharePoint List name is: "ParameterList" (pretty creative, huh?)

     I have tried to hack the formula to use my data, but no dice.

    I've tried several iterations, to no avail.(more, i'm just showing two.)

    eval(eval(Parameter2[Title = "User"], "concat(my:Parameter2, ';')"), "..") - no worky
    .. [xdMath:Eval(xdMath:Eval(xdXDocument:GetDOM("ParameterList")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Parameter2[../d:Title = "User"], "concat(my:email, ';')"), "..")]

    eval(eval(Title[Title = "User"], "concat(my:Parameter2, ';')"), "..") - no worky 
    .. [xdMath:Eval(xdMath:Eval(xdXDocument:GetDOM("ParameterList")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[. = "User"], "concat(my:email, ';')"), "..")]

     

     <sigh>

     

     

  • 09-14-2015 10:36 AM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

    Can you attach your form (or a sample) under the Options tab so I can see the secondary data connection?
    Hilary Stoupa

  • 09-14-2015 11:19 AM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

     Okay, I felt I needed to make a sample form, Justin Case. It's attached for your viewing pleasure. :)

    Ray

  • 09-14-2015 11:42 AM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

     Can you check the main data source field in this copy - I've added a default value that I think will do what you want. Save it locally, right click and select design to open in IP, then preview. Thanks for including all the details in the sample - that was very helpful.

    Hilary Stoupa

  • 09-14-2015 12:34 PM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

    hmmm... I guess i'm not as smart as I thought I was.

    I clicked on the link in the header, and downloaded that file, however, I cannot see any changes in the data source.
    Where do I look?

    I clicked on the "Data Connections" in the Data tab and when through the options on the ParameterList under "Modify" and did not see any differences to my original.

    I also selected  "ParameterList in the dropdown in the "Felds" area and clicked on all the different fields to look for some "default" values, but didn't find any.
    (I looked in both the query and the data fields to be accurate)

     

  • 09-14-2015 12:49 PM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

    I added a default value to the main data source field UserEmailIDs that should concatenate all the users from your secondary data connection?
    Hilary Stoupa

  • 09-14-2015 01:12 PM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

     Haha! I was looking all over the datasource area but never thought to look at the receiving field default. DUH!

    I need some more "Anti-Monday dummy" coffee!

    I have previewed it and it is giving me blanks right now, but you have given me a solid base to work from troubleshooting it. 

     

    You should either marry me or adopt me so you can claim me as a dependent! haha! :)

     

    Thanks!!!!!!!!!

     

  • 09-14-2015 01:53 PM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

     Mystery solved. 

    The reason your modified form was giving me blanks was because I had not removed all that form load code I put in.

    So it stuck blanks over the top of your default value code.

    It works! Your code is majak!

    :) 

     

    Thanks again...

    Ray

  • 09-14-2015 02:02 PM In reply to

    Re: Solution to get data from a sharepoint list, operate on it and put results into a semicolon delimited list for workflow without code

    Wonderful, glad it worked!
    Hilary Stoupa

Page 1 of 1 (13 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.